Skip to content
This repository was archived by the owner on Jun 11, 2021. It is now read-only.

NGX Compatibility: TypeError: Cannot read property 'kind' of undefined #4

Open
jamesthurley opened this issue Dec 6, 2017 · 3 comments

Comments

@jamesthurley
Copy link

Hi, great library. I've tried the following steps on Angular CLI 1.5.2 and 1.5.5:

ng new scrollimate-test
cd scrollimate-test
npm install ng2-scrollimate --save
ng build --prod

The above succeeds, however if I add import {Ng2ScrollimateModule} from 'ng2-scrollimate'; to the top of app.module.ts and add Ng2ScrollimateModule to the module imports list, and then run ng build --prod again, I get the following error:

ERROR in ./node_modules/ng2-scrollimate/dist/src/ng2-scrollimate.directive.js
Module build failed: TypeError: Cannot read property 'kind' of undefined

It works fine without --prod and works fine running under ng serve. Removing Ng2ScrollimateModule also makes it work again.

Interestingly if I bring the four typescript files from your src directory into my project as a local module it also works fine.

@bergben
Copy link
Owner

bergben commented Dec 6, 2017

Hey @jamesthurley, unfortunately this module only supports Angular 2.x. The Angular CLI versions you are using create Angular 5.x apps...

@jamesthurley
Copy link
Author

Hi @bergben, thanks for the quick reply! Interesting, I saw that in your readme but hoped it really just meant "not Angular 1.x" ;)

It's actually working well for me in 5.x for my limited use case. Is there something specific you know of which doesn't work which I should avoid? (other than the above issue, which I've worked around for the moment!)

Out of interest, how come you stopped developing it? Is there another library you'd recommend instead?

@bergben
Copy link
Owner

bergben commented Dec 6, 2017

Mostly I just lack time for further development for the module.
I think I know what breaks it for Angular 5, as for some of my other libraries it is probably the build optimizer: bergben/ng2-img-max#17
So to be compatible it wouldn't even take that much but IDK if by now certain things could be done in a better way, I'd have to go over the code...

@bergben bergben changed the title TypeError: Cannot read property 'kind' of undefined NG5 Compatibility: TypeError: Cannot read property 'kind' of undefined Dec 6, 2017
@bergben bergben changed the title NG5 Compatibility: TypeError: Cannot read property 'kind' of undefined NGX Compatibility: TypeError: Cannot read property 'kind' of undefined Dec 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants