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

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

Closed
mwyld opened this issue May 29, 2020 · 9 comments
Closed

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

mwyld opened this issue May 29, 2020 · 9 comments

Comments

@mwyld
Copy link

mwyld commented May 29, 2020

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
@matts-bot
Copy link

matts-bot bot commented May 29, 2020

Thanks so much for opening an issue! If you'd like me to give priority to answering your issue or would just like to support this project, then please consider sponsoring me

@Nimzi-Git
Copy link

Have same issue with module. I am continuously increasing the memory but is not the fix :(

@mattlewis92
Copy link
Owner

Hey, sorry to hear you're having issues. It sounds like the problem is being caused because your angular version (v7) doesn't match your angular cli version (v8). Please can you either upgrade the framework from v7 to v8 or downgrade the cli to v7. If that doesn't work please can you provide a minimal runnable repro on github, as without that it's really hard to say what's going wrong. Thank you! 😄

@mwyld
Copy link
Author

mwyld commented May 29, 2020

Apologies, I forgot to mention that the CLI version was actually the version of on my build server. I was using CLI version 7.3.10 and I was still hitting the same issue.

I cannot share my current repo but I will create a seperate new one if this helps?

@no-response no-response bot removed the needs reply label May 29, 2020
@mattlewis92
Copy link
Owner

I cannot share my current repo but I will create a seperate new one if this helps?

Yeah if you can just create a new minimal repro that shows your issue that would be awesome. Alternatively a quicker way might be to try installing every patch version of angular-calendar between 0.28.5 and 0.28.15 in your app and then find the exact version that breaks, that would tell me exactly which commit broke it and give me an idea of where to look. Thanks! 😄

@mwyld
Copy link
Author

mwyld commented May 29, 2020

I've created a small public repo here: https://github.com/mwyld/calendar-test

I am just using npm i && ng build --prod to get the issue.

if you get a memory warning try

node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng build --prod

Trying some other things at the moment, I'll update this thread if I get to the bottom of it

@no-response no-response bot removed the needs reply label May 29, 2020
@mwyld
Copy link
Author

mwyld commented May 29, 2020

So after further investigation it appears to be an issue between version 0.28.5 and 0.28.15.
After removing the ^ character it worked again

@mattlewis92
Copy link
Owner

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 😄

@mwyld
Copy link
Author

mwyld commented Jun 1, 2020

Thanks Matt! thanks for the quick turnaround on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants