-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Runtime error "Cannot find module ...ngfactory" for lazy module with @ngtools/webpack 1.3.3 #6518
Comments
Duplicate of #4431 Issue with |
@sumitarora I tried in the past removing that plugin, it does not make any effect. |
Please consider reopening this issue, it might hide other problems |
May not be duplicate as in this bug chunks are created. |
@hheexx I checked after commenting the @GiuseppePiscopo Can you check comment the plugin in prod config and on running build I get this output? Asset Size Chunks Chunk Names
js/0-chunk.js 11.6 kB 0 [emitted]
js/main-bundle.js 185 kB 1 [emitted] main
js/vendor-bundle.js 1.77 MB 2 [emitted] [big] vendor
css/main-bundle.css 1.38 kB 1 [emitted] main
js/0-chunk.js.map 12.8 kB 0 [emitted]
js/main-bundle.js.map 253 kB 1 [emitted] main
css/main-bundle.css.map 96 bytes 1 [emitted] main
js/vendor-bundle.js.map 2.17 MB 2 [emitted] vendor
index.html 1.32 kB [emitted]
images/favicon.ico 32 kB [emitted] |
@sumitarora you are right. Not sure what has changed, as in previous iterations of that sample project I did try commenting out that plugin, having read about that issue already, and it did not help. I can confirm that the lazy module chunk gets built:
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)#4637 has been closed due to changed version, and it is suggested to open a new issue for the currently available version.
#6443 at some point shows this error in a log, but I don't think it is really related.
Versions.
ng --version
. ng is not installed in this project.@
ngtools/webpack is.node --version
: v6.2.2npm --version
: 3.9.5@
ngtools/webpack 1.3.3,Repro steps.
There's a mini sample project showing the issue.
npm i
npm run build-prod
npm run serve
http://localhost:3000
The log given by the failure.
NOTE: UglifyJs has been temporarily disabled in production build, to have a clearer stacktrace. Problem shows up also with UglifyJs applied, showing this stacktrace:
Desired functionality.
When clicking on link to lazy loaded module, page should show correctly.
Mention any other details that might be useful.
Somewhat differently than other projects, in this one module files are all named
module.ts
(and of course placed in their ownwhatever
directory), instead of beingwhatever.module.ts
.This project uses tslib, Microsoft Runtime library for TypeScript helpers, together with
noEmitHelpers
andimportHelpers
flags as suggested in this postAfter a development build, the JS chunk for lazy loaded module is correctly found in output directory:
dist/js/0-chunk.js
, as well as its sourcemap. After a production build instead, only sourcemap is found, no JS.As said, a demo project is available at https://github.com/BrainCrumbz/ngtools-webpack-demo.
The text was updated successfully, but these errors were encountered: