No NgModule metadata found for '" + stringify(type) on npm run serve:ssr
See original GitHub issuePS D:\universal> npm run serve:ssr
angular-io-example@1.0.0 serve:ssr D:\universal node dist/server.js
D:\universal\dist\server.js:56323 throw new Error(“No NgModule metadata found for '” + stringify(type) + “'.”); ^
Error: No NgModule metadata found for ‘function (e,r){this.platformId=e,this.appId=r;var n=t.isPlatformBrowser(e)?“on the server”:“in the
browser”;console.log(“Running “+n+” with appId=”+r)}’.
at NgModuleResolver.resolve (D:\universal\dist\server.js:56323:23)
at CompileMetadataResolver.getNgModuleMetadata (D:\universal\dist\server.js:51313:60)
at JitCompiler._loadModules (D:\universal\dist\server.js:69797:87)
at JitCompiler._compileModuleAndComponents (D:\universal\dist\server.js:69758:36)
at JitCompiler.compileModuleAsync (D:\universal\dist\server.js:69674:37)
at CompilerImpl.compileModuleAsync (D:\universal\dist\server.js:86507:49)
at PlatformRef.bootstrapModule (D:\universal\dist\server.js:6666:25)
at Object.cDNt (D:\universal\dist\server.js:113637:1152)
at n (D:\universal\dist\server.js:113637:158)
at Object.0 (D:\universal\dist\server.js:113637:545)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-io-example@1.0.0 serve:ssr: node dist/server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-io-example@1.0.0 serve:ssr script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\pc\AppData\Roaming\npm-cache_logs\2018-01-29T09_52_52_858Z-debug.log PS D:\universal> npm run serve:ssr
angular-io-example@1.0.0 serve:ssr D:\universal node dist/server.js
D:\universal\dist\server.js:56323 throw new Error(“No NgModule metadata found for '” + stringify(type) + “'.”); ^
Error: No NgModule metadata found for ‘function (e,r){this.platformId=e,this.appId=r;var n=t.isPlatformBrowser(e)?“on the server”:“in the
browser”;console.log(“Running “+n+” with appId=”+r)}’.
at NgModuleResolver.resolve (D:\universal\dist\server.js:56323:23)
at CompileMetadataResolver.getNgModuleMetadata (D:\universal\dist\server.js:51313:60)
at JitCompiler._loadModules (D:\universal\dist\server.js:69797:87)
at JitCompiler._compileModuleAndComponents (D:\universal\dist\server.js:69758:36)
at JitCompiler.compileModuleAsync (D:\universal\dist\server.js:69674:37)
at CompilerImpl.compileModuleAsync (D:\universal\dist\server.js:86507:49)
at PlatformRef.bootstrapModule (D:\universal\dist\server.js:6666:25)
at Object.cDNt (D:\universal\dist\server.js:113637:1152)
at n (D:\universal\dist\server.js:113637:158)
at Object.0 (D:\universal\dist\server.js:113637:545)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-io-example@1.0.0 serve:ssr: node dist/server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-io-example@1.0.0 serve:ssr script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\pc\AppData\Roaming\npm-cache_logs\2018-01-29T09_57_58_448Z-debug.log PS D:\universal>
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (1 by maintainers)
so, haw we can solve the problem ?
from https://angular.io/guide/universal, latest sample code fixed with this https://github.com/angular/universal-starter/issues/462 working fine