Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 7 production build issue #214

Closed
nitinht1988 opened this issue Nov 6, 2018 · 4 comments
Closed

Angular 7 production build issue #214

nitinht1988 opened this issue Nov 6, 2018 · 4 comments

Comments

@nitinht1988
Copy link

nitinht1988 commented Nov 6, 2018

Hello there,

After upgrading my project to Angular 7 i am getting below error while running ng build --prod command. ng serve is working fine.

ERROR in : Unexpected value 'ChartistModule in E://node_modules/ng-chartist/bundles/ng-chartist.umd.js' imported by the module 'ChartsNg2Module in E://src/app/charts/charts.module.ts'. Please add a @NgModule annotation.

When i hover over the import statement in the module file it says:

Could not find a declaration file for module 'ng-chartist'. 'e:/node_modules/ng-chartist/bundles/ng-chartist.umd.js' implicitly has an 'any' type.
Try npm install @types/ng-chartist if it exists or add a new declaration (.d.ts) file containing declare module 'ng-chartist';
[ts]
Could not find a declaration file for module 'ng-chartist'. 'e:/node_modules/ng-chartist/bundles/ng-chartist.umd.js' implicitly has an 'any' type.
Try npm install @types/ng-chartist if it exists or add a new declaration (.d.ts) file containing declare module 'ng-chartist';

"@angular/core": "7.0.0",
"ng-chartist": "^2.0.0-beta.1",
"@types/chartist": "0.9.43",
"chartist": "0.11.0",

Thank you.

@willsoto
Copy link
Owner

This has been an on-going issue - See #198 #150. I don't use Angular on a regular basis and so I really don't know how to fix this. I am open to PRs.

@hakimio
Copy link
Collaborator

hakimio commented Jan 8, 2019

@willsoto
You have to properly generate your library using angular cli like explained in the following guide:
https://blog.angularindepth.com/creating-a-library-in-angular-6-87799552e7e5

Otherwise Angular 6 and 7 aot builds will fail (which is rather important).
If you are not planning to update this library, you should state in the Readme that the library is only compatible with Angular 4 and 5.

@willsoto
Copy link
Owner

willsoto commented Jan 8, 2019

I'll see if I can find some time next weekend.

As I said before, I am more than willing to review a PR if someone opens one and the issue would probably get resolved faster if someone does go that route.

@willsoto
Copy link
Owner

Closed via #216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants