Cannot read property 'kind' of undefined in angular 8.2.14
nombrekeff opened this issue · 10 comments
I updated my dependencies yesterday, and when building --prod, it throws the following error:
ERROR in ./node_modules/ngx-country-picker/fesm2015/ngx-country-picker.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 (/Users/manolo/Documents/Dev/work/rec/rec-admin-ngcli/rec-admin/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:265:35)
This started happening with Angular v8.2.14
and ngx-country-picker v2.2.0
This did not happen with Angular v8.1.3
Going back to ngx-country-picker v2.1.0
fixes the issue, though...
Hi sorry about this, it seems it is an issue with not updating Typescript!
Updating ts seems to fix the
i have the same issue and I do not understand the solution.
I am using angular 7 and typescript 3.1.3
the problem only persists when building with --prod
flag
Any advice for me?
Have you tried updating typescript? I currently use typescript@3.4.5
, if error persists I will recommend you try and update Angular CLI, and Angular, If this is something you can do.
I am using other components which seen to need the old typescript version. I tried to update but then ran into other dependency issues. The bug you posted previously is talking about 3.7.3, though. I don't think it can be related then, if you use 3.4.5.
If I try to use 3.4.5, I get:
@angular/compiler-cli@7.2.16 requires typescript@'>=3.1.1 <3.3' but 3.4.5 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@">=3.1.1 <3.3"
To disable this warning run "ng config cli.warnings.typescriptMismatch false".
If I try the highest possible version, 3.2.4, of typescript. It still fails. This is a dependecy hell and, yes, I need to update my application. I took this unmaintained thing over and I am new to angular, so no idea at the moment what I can do, except sticking to country picker 2.1.0 :(
Ohh sorry I forgot about that, I got into these errors too, I will look up what I ended up doing
I took this unmaintained thing over and I am new to angular, so no idea at the moment what I can do, except sticking to country picker 2.1.0 :(
Relatable, I have been in those situations more times than I like to admit :P
I will try gathering all the info I can on how I fixed it though
I ended up downgrading back to 2.1.0
as well, it seems.
@nombrekeff Can you re-open the Ticket please?
@guillaume-ro-fr can we have your attention please?
Sure!
Although I'm not certain it's this project's fault, I think it has more to do with angular and typescript.