Angular6: No NgModule metadata found for '[object Object]'
See original GitHub issueHello. Updated my portfolio to Angular6 but got stuck with SSR. I have my code online (https://github.com/nekkon/portfolio)
Everything gets built and runs properly without any errors. Even when I run serve:ssr. But, when I visit http://localhost:3000 I get the error below:
Node Express server listening on http://localhost:3000
Error: No NgModule metadata found for '[object Object]'.
at NgModuleResolver.resolve (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:49357:23)
at CompileMetadataResolver.getNgModuleMetadata (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:47994:43)
at JitCompiler._loadModules (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:60132:51)
at JitCompiler._compileModuleAndComponents (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:60113:36)
at JitCompiler.compileModuleAsync (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:60073:37)
at CompilerImpl.compileModuleAsync (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:79885:31)
at /nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:37289:25
at new ZoneAwarePromise (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:1027:29)
at getFactory (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:37275:12)
at View.engine (/nekkon/nekkon/Desktop/projects/portfolio/dist/server.js:37254:13)
Angular: 6.0.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cdk 6.2.1
@angular/cli 6.0.8
@angular/flex-layout 6.0.0-beta.16
@angular/material 6.2.1
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.0
typescript 2.7.2
webpack 4.12.0
Any idea what is causing this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Error: No NgModule metadata found for '[object Object]'
I am attempting to convert my angular 6 application to server side rendering (for SEO purposes), and everything seems to compile without ......
Read more >Error: No NgModule metadata found for '[object Object]' #32838
Closing as no reproduction was provided, and the original issue seems related to running ngcc and then compiling with View Engine.
Read more >Angular – All Possible Solutions for 'No NgModule' - Stack 24/7
The error “No NgModule metadata found for 'AppModule'” could be caused by various reason: Moving Angular project folder.
Read more >No NgModule metadata found for 'AppServerModule'
But next I'm getting an error: "No NgModule metadata found for '[object Object]" With native router lazy load of same module works normally....
Read more >Getting "No NgModule metadata found for 'class{}'." with ...
It seems that it is trying to find the bootstrapModule and platformBrowserDynamic functions within the entry module where the module class is defined....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have the same issue. I tried to use suggested config, but this did not solve the issue.
Since @nekkon fixed their original issue, we are closing this. If others are experiencing issues that can’t be solved by this fix, please open a separate issue.