question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'kind' of undefined` - Potential Memory Leak?

See original GitHub issue

Describe the bug

Hi Matt Lewis,

I seem to be getting the following issue when building my angular 7 application for production:

ERROR in ./node_modules/angular-calendar/fesm5/angular-calendar.js Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Cannot read property 'kind' of undefined

I have tried the following:

upgraded to the latest version of angular-calendar from v0.28.5 to v0.28.15 increased the memory allocation by using node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng build --prod

Here are our details

We are using angular CLI version v8.0.2 node version v10.1.6

Full Error:

ERROR in ./node_modules/angular-calendar/fesm5/angular-calendar.js Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Cannot read property 'kind' of undefined at isAngularDecoratorMetadataExpression (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file .js:265:35) at checkNodeForDecorators (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:77:21) at visitNodes (c:\WorkspaceXXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16144:30) at Object.forEachChild (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js: 16370:24) at checkNodeForDecorators (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31) at visitNode (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16135:24) at Object.forEachChild (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js: 16265:21) at checkNodeForDecorators (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31) at visitNode (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16135:24) at Object.forEachChild (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js: 16322:24) at checkNodeForDecorators (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31) at visitNode (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16135:24) at Object.forEachChild (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js: 16333:24) at checkNodeForDecorators (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31) at visitNode (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16135:24) at Object.forEachChild (c:\Workspace\XXX\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js: 16229:21)

Minimal reproduction of the problem with instructions

ng build --prod on the application angular-calendar is on

Screenshots

N/A

Versions

  • @angular/core: 7.1.0
  • angular-calendar: 0.28.15
  • Browser name and version: N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mwyldcommented, Jun 1, 2020

Thanks Matt! thanks for the quick turnaround on this!

2reactions
mattlewis92commented, May 30, 2020

Thanks for putting together that repo, it really helped. I found the issue and a workaround, so this should be fixed now in 0.28.16 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'kind' of undefined at ...
This problem started to occur when updating my Angular 6 project to 7.x. I opened an issue on the angular-cli github repo but...
Read more >
Memory management - JavaScript - MDN Web Docs
Using values basically means reading and writing in allocated memory. This can be done by reading or writing the value of a variable...
Read more >
A Definitive Guide to Handling Errors in JavaScript
The error “Uncaught TypeError: Cannot read properties of undefined” is shown on a TypeError example with undefined function.
Read more >
4. Memcheck: a memory error detector
Note that the --leak-resolution setting does not affect Memcheck's ability to find leaks. It only changes how the results are presented. --show-leak-kinds=<set> ...
Read more >
The 10 Most Common JavaScript Issues Developers Face
Memory leaks are almost inevitable JavaScript issues if you're not consciously ... from objects) cannot be used on nonconfigurable properties of the object....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found