Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'id' of undefined #37661

Open
Javaman2 opened this issue Jun 21, 2020 · 0 comments
Open

Uncaught TypeError: Cannot read property 'id' of undefined #37661

Javaman2 opened this issue Jun 21, 2020 · 0 comments
Labels
Milestone

Comments

@Javaman2
Copy link

@Javaman2 Javaman2 commented Jun 21, 2020

🐞 bug report

Affected Package

packages/core/src/linker/ng_module_factory_registration.ts

export function registerNgModuleType(ngModuleType: NgModuleType) {
 // If id emod is undefined an error is thrown.
 if (ngModuleType.ɵmod.id !== null) {

Is this a regression?

No

Description

This line:

ngModuleType.ɵmod.id !== null

Results in this:

Uncaught TypeError: Cannot read property 'id' of undefined
    at registerNgModuleType (core.js:36228)
    at core.js:36246
    at Array.forEach (<anonymous>)
    at registerNgModuleType (core.js:36242)
    at core.js:36246
    at Array.forEach (<anonymous>)
    at registerNgModuleType (core.js:36242)
    at new NgModuleFactory$1 (core.js:36407)
    at compileNgModuleFactory__POST_R3__ (core.js:42296)
    at PlatformRef.bootstrapModule (core.js:42663)

Would be nice to catch the error and tell the user which module is failing.

This was failing in the MatPaginator module. It is probably an incorrect import but not sure yet.

I've written an article on the journey to determine root cause.

🌍 Your Environment

Angular Version:


Angular CLI: 9.1.8
Node: 12.18.0
OS: win32 x64

Angular: 9.1.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.901.8
@angular-devkit/build-angular      0.901.8
@angular-devkit/build-ng-packagr   0.901.8
@angular-devkit/build-optimizer    0.901.8
@angular-devkit/build-webpack      0.901.8
@angular-devkit/core               9.1.8
@angular-devkit/schematics         9.1.8
@angular/cdk                       9.2.4
@angular/cli                       9.1.8
@angular/material                  9.2.4
@ngtools/webpack                   9.1.8
@schematics/angular                9.1.8
@schematics/update                 0.901.8
ng-packagr                         9.1.5
rxjs                               6.5.5
typescript                         3.7.5
webpack                            4.42.0


Anything else relevant?

No

@mhevery mhevery added the comp: core label Jun 22, 2020
@ngbot ngbot bot added this to the needsTriage milestone Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.