PS D:\universal> npm run serve:ssr
[email protected] 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! [email protected] serve:ssr: node dist/server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\pcAppData\Roaming\npm-cache_logs\2018-01-29T09_52_52_858Z-debug.log
PS D:\universal> npm run serve:ssr
[email protected] 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! [email protected] serve:ssr: node dist/server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\pcAppData\Roaming\npm-cache_logs\2018-01-29T09_57_58_448Z-debug.log
PS D:\universal>
This stringify function you have there, is it something your making sure to export from whatever file it's in? This looks like it might be the AoT compiler not being able to statically analyze the code.
from https://angular.io/guide/universal, latest sample code fixed with this https://github.com/angular/universal-starter/issues/462
working fine
This issue is still present. Tested with source code downloaded from https://angular.io/guide/universal
Hi,
By checking out the universal-starter project and using main.server.ts from it, I'm able to resolve the issue.
I don't know why but the guide at https://angular.io/guide/universal doesn't mention what's in main.server.ts and the sample source code downloaded from the guide doesn't include that file either.
Problem solved.
Any update on this issue, I am also facing the same problem.
so, haw we can solve the problem ?
Any solution found for this problem?
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._