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

ng build fails when AOT is enabled #187

Closed
jplatasv opened this issue Oct 19, 2017 · 3 comments
Closed

ng build fails when AOT is enabled #187

jplatasv opened this issue Oct 19, 2017 · 3 comments
Assignees
Labels

Comments

@jplatasv
Copy link

jplatasv commented Oct 19, 2017

Hi,

I've noticed that using AOT to build the project makes the process fail:

jplatasv@hostname:~/someprojectpath$ ng build --target=production --environment=prod
Your global Angular CLI version (1.4.5) is greater than your local
version (1.4.3). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
Date: 2017-10-19T08:01:16.627Z                                                     
Hash: 751d59b4a91ca382ecf2
Time: 2299ms
chunk {0} styles.3367d77994252802baa7.bundle.css (styles) 43 bytes {3} [initial] [rendered]
chunk {1} polyfills.3bc34265385d52184eab.bundle.js (polyfills) 86 bytes {3} [initial] [rendered]
chunk {2} main.e402deade8b026b7d50e.bundle.js (main) 84 bytes [initial] [rendered]
chunk {3} inline.22b7623ed7c5ac6f9a35.bundle.js (inline) 1.45 kB [entry] [rendered]

ERROR in Error: Cannot determine the module for class PdfViewerComponent in /home/someprojectpath/node_modules/ng2-pdf-viewer/dist/pdf-viewer.component.d.ts! Add PdfViewerComponent to the NgModule to fix it.
at Error (native)
at syntaxError (/home/someprojectpath/node_modules/@angular/compiler/bundles/compiler.umd.js:1729:34)
at analyzeAndValidateNgModules (/home/someprojectpath/node_modules/@angular/compiler/bundles/compiler.umd.js:24306:15)
at AotCompiler.analyzeModulesAsync (/home/someprojectpath/node_modules/@angular/compiler/bundles/compiler.umd.js:23937:46)
at CodeGenerator.codegen (/home/someprojectpath/node_modules/@angular/compiler-cli/src/codegen.js:32:14)
at Function.NgTools_InternalApi_NG_2.codeGen (/home/someprojectpath/node_modules/@angular/compiler-cli/src/ngtools_api.js:73:30)
at _donePromise.Promise.resolve.then (/home/someprojectpath/node_modules/@ngtools/webpack/src/plugin.js:386:44)
at process._tickCallback (internal/process/next_tick.js:109:7)

This does not happen when AOT is disabled:

jplatasv@hostname:~/someprojectpath$ ng build --target=production --environment=prod --aot false
Your global Angular CLI version (1.4.5) is greater than your local
version (1.4.3). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
Date: 2017-10-19T08:10:00.007Z                                                          
Hash: 12ce0a0203ed08867f9f
Time: 26391ms
chunk {0} polyfills.d8d3d78a4deb2ab66856.bundle.js (polyfills) 66.1 kB {4} [initial] [rendered]
chunk {1} main.6a39ab8d0b201c6d59b4.bundle.js (main) 89.5 kB {3} [initial] [rendered]
chunk {2} styles.3367d77994252802baa7.bundle.css (styles) 43 bytes {4} [initial] [rendered]
chunk {3} vendor.ba8abec385dc996b45cf.bundle.js (vendor) 1.35 MB [initial] [rendered]
chunk {4} inline.f3df3004ae624d7c4a8c.bundle.js (inline) 1.45 kB [entry] [rendered]
@VadimDez
Copy link
Owner

I've just tried myself

ng build --target=production --environment=prod

and had no errors

@VadimDez
Copy link
Owner

VadimDez commented Nov 6, 2017

Do you still have this error?

@jplatasv
Copy link
Author

jplatasv commented Nov 7, 2017

Hi VadimDez,

We finally removed the component from the project. We haven't had the chance to deep test it. Sorry.

Thanks anyway for your feedback

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

No branches or pull requests

2 participants