production build issue `Uncaught Error: No NgModule metadata found for 't'.`
See original GitHub issue[x] bug report => check the README and search github for a similar issue or PR before submitting
[ ] support request => check the README and search github for a similar issue or PR before submitting
[ ] feature request
Current behavior It seems to be that recently an npm dependency has been updated which causes silent build issues for production builds, both build:universal-prod and build:spa-prod . Previously everything has been working fine as for production builds but sometime in the last week these issues have arose.
Webpack itself gives no errors during the build but no css file is generated in the public folder. The app will run but the css styles for the main app bundle do not show (lazy loaded modules still seem to display css for their components).
An error gets generated in the console
Uncaught Error: No NgModule metadata found for 't'.
at t.resolve (app.3be5665….bundle.js:1)
at t.getNgModuleMetadata (app.3be5665….bundle.js:1)
at t._loadModules (app.3be5665….bundle.js:1)
at t._compileModuleAndComponents (app.3be5665….bundle.js:1)
at t.compileModuleAsync (app.3be5665….bundle.js:1)
at e._bootstrapModuleWithZone (app.3be5665….bundle.js:1)
at e.bootstrapModule (app.3be5665….bundle.js:1)
at r (app.3be5665….bundle.js:1)
at r (app.3be5665….bundle.js:1)
at Object.163 (app.3be5665….bundle.js:1)
I attempted to trace this through but no luck as of yet. I will take more of a look at the production webkit builds over the next day or two and see if I can isolate the issue. In the mean time it would be great if anyone else could reproduce.
Expected/desired behavior Prod Build should compile the production bundles including CSS with no errors.
Minimal reproduction of the problem with instructions I have tried with existing projects using this repository as well as cloning a new repo from this one.
Clone this repository locally Run
npm install
npm run build:universal-prod
npm run serve:universal
If you have an existing code base using this repository
rm -rf node_modules
npm cache clean
npm install
npm run build:universal-prod
npm run serve:universal
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (9 by maintainers)
@ChrisDalley this has been solved using the latest @ngtools/webpack.
@ChrisDalley I edited the post,
@ngtools/webpack
appears now 😄