Open karwank opened 4 years ago
My /home/deploy/ng-app/dist/app/server/main.js:80232-80234
file contains:
function registerNgModuleType(ngModuleType) {
if (ngModuleType.ɵmod.id !== null) {
/** @type {?} */
const id = ngModuleType.ɵmod.id;
/** @type {?} */
const existing = (/** @type {?} */ (modules.get(id)));
assertSameOrNotExisting(id, existing, ngModuleType);
modules.set(id, ngModuleType);
}
/** @type {?} */
let imports = ngModuleType.ɵmod.imports;
if (imports instanceof Function) {
imports = imports();
}
if (imports) {
imports.forEach((/**
* @param {?} i
* @return {?}
*/
i => registerNgModuleType((/** @type {?} */ (i)))));
}
}
This is of course part of @angular/cli package. I've added console.log(ngModuleType)
to see what exactly is being registered there. This is my output:
{ [Function: AppServerModule]
'ɵmod':
{ type: [Circular],
bootstrap: [ [Function] ],
declarations: [],
imports:
[ [Function], [Function], [Function], [Function], [Function] ],
exports: [],
transitiveCompileScopes: null,
schemas: null,
id: null },
'ɵinj':
{ factory: [Function: AppServerModule_Factory],
providers: [],
imports: [ [Array] ] },
decorators: [ { type: [Function], args: [Array] } ] }
{ [Function: AppModule]
'ɵmod':
{ type: [Circular],
bootstrap: [ [Function] ],
declarations: [ [Function], [Function], [Function] ],
imports:
[ [Function], [Function], [Function], [Function], [Function] ],
exports: [],
transitiveCompileScopes: null,
schemas: null,
id: null },
'ɵinj':
{ factory: [Function: AppModule_Factory],
providers:
[ [Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Function],
[Object] ],
imports: [ [Array] ] },
decorators: [ { type: [Function], args: [Array] } ],
ctorParameters: [Function] }
{ [Function: RouterModule]
'ɵmod':
{ type: [Circular],
bootstrap: [],
declarations:
[ [Function], [Function], [Function], [Function], [Function] ],
imports: [],
exports:
[ [Function], [Function], [Function], [Function], [Function] ],
transitiveCompileScopes: null,
schemas: null,
id: null },
'ɵinj':
{ factory: [Function: RouterModule_Factory],
providers: [],
imports: [] },
ctorParameters: [Function],
decorators: [ { type: [Function], args: [Array] } ] }
{ [Function: BrowserModule]
'ɵmod':
{ type: [Circular],
bootstrap: [],
declarations: [],
imports: [],
exports: [Function: exports],
transitiveCompileScopes: null,
schemas: null,
id: null },
'ɵinj':
{ factory: [Function: BrowserModule_Factory],
providers:
[ [],
[Object],
[Object],
[Object],
[Object],
[],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[] ],
imports: [ [Function], [Function] ] },
ctorParameters: [Function],
decorators: [ { type: [Function], args: [Array] } ] }
{ [Function: HttpClientModule]
'ɵmod':
{ type: [Circular],
bootstrap: [],
declarations: [],
imports: [ [Function] ],
exports: [],
transitiveCompileScopes: null,
schemas: null,
id: null },
'ɵinj':
{ factory: [Function: HttpClientModule_Factory],
providers:
[ [Function], [Object], [Function], [Object], [Function], [Object] ],
imports: [ [Array] ] },
decorators: [ { type: [Function], args: [Array] } ] }
{ [Function: HttpClientXsrfModule]
'ɵmod':
{ type: [Circular],
bootstrap: [],
declarations: [],
imports: [],
exports: [],
transitiveCompileScopes: null,
schemas: null,
id: null },
'ɵinj':
{ factory: [Function: HttpClientXsrfModule_Factory],
providers: [ [Function], [Object], [Object], [Object], [Object] ],
imports: [] },
decorators: [ { type: [Function], args: [Array] } ] }
{ [Function: NgxJsonapiModule]
forRoot: [Function],
decorators: [ { type: [Function], args: [Array] } ],
ctorParameters: [Function] }
TypeError: Cannot read property 'id' of undefined
at registerNgModuleType (/home/deploy/ng-app/dist/app/server/main.js:80300:27)
at imports.forEach.i (/home/deploy/ng-app/dist/app/server/main.js:80318:14)
at Array.forEach (<anonymous>)
at registerNgModuleType (/home/deploy/ng-app/dist/app/server/main.js:80314:17)
at imports.forEach.i (/home/deploy/ng-app/dist/app/server/main.js:80318:14)
at Array.forEach (<anonymous>)
at registerNgModuleType (/home/deploy/ng-app/dist/app/server/main.js:80314:17)
at new NgModuleFactory$1 (/home/deploy/ng-app/dist/app/server/main.js:80458:13)
at Compiler_compileModuleSync__POST_R3__ (/home/deploy/ng-app/dist/app/server/main.js:84374:12)
at Compiler_compileModuleAsync__POST_R3__ [as compileModuleAsync] (/home/deploy/ng-app/dist/app/server/main.js:84387:28)
As I understand for some reason ngx-jsonapi hasn't been compiled properly or in other words properly prepared to work with Ivy compiler. All registered modules, except ngx-jsonapi module, have those 'ɵmod' and 'ɵinj' keys. Is it possible that your module is just not prepared to work with higher version of Angular?
package.json
angular.json:
app.module.ts:
when I do:
npm run build:prod
everything compiles properly:but when I start it:
node dist/app/server/main.js
i got: