max max
max max

Reputation: 13

Angular getting error core.js:35929 Uncaught TypeError: Cannot read property 'id' of undefined

I have an angular project running on my PC without any errors. When I try to open the project on another PC I get this error when running the cliend side (backend runs without problems):

core.js:35929 Uncaught TypeError: Cannot read property 'id' of undefined
    at registerNgModuleType (core.js:35929)
    at core.js:35947
    at Array.forEach (<anonymous>)
    at registerNgModuleType (core.js:35943)
    at core.js:35947
    at Array.forEach (<anonymous>)
    at registerNgModuleType (core.js:35943)
    at new NgModuleFactory$1 (core.js:36105)
    at compileNgModuleFactory__POST_R3__ (core.js:41895)
    at PlatformRef.bootstrapModule (core.js:42260)

Please help me understand what i'm missing in the new computer,I believe it might be even a code line i need to run in the console like npm..

Upvotes: 0

Views: 622

Answers (2)

Shlok Nangia
Shlok Nangia

Reputation: 2377

Most probably you are getting this error because of version mismatch for some module

I got the same error for lodash version mismatch

To find the culprit you can use following approach and change its version

enter image description here

In sources tab of your chrome devtools

  1. click on this pause icon on extreme right
  2. Check the pause on exception checkbox

Now it will pause before breaking and you can know which module's version needs to be changed

Upvotes: 0

Kishor Kunal
Kishor Kunal

Reputation: 267

You are trying to access 'id' property of something which is undefined(not initialized) in an array. If your project is not big enough , you can search for ".id" in *.ts files and if result set is small you can figure out where the problem is. Also if you can provide the project source , it will be easier to help you. -- Thanks

Upvotes: 1

Related Questions