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.0angular-calendar: 0.28.15Thanks 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
Have same issue with module. I am continuously increasing the memory but is not the fix :(
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! 馃槃
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?
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! 馃槃
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
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
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 馃槃
Thanks Matt! thanks for the quick turnaround on this!
Most helpful comment
Thanks Matt! thanks for the quick turnaround on this!