I'm not exactly sure what I did, but I installed angular-moment-timezone
in my Ionic project today, got it working, could run ionic serve
just fine, but then I decided to remove my node_modules
folder. Once I did that, I ran npm i
and once that all finished, anytime I try to run ionic serve
, I get these errors:
Typescript Error
Cannot redeclare block-scoped variable 'tz'.
node_modules/@types/moment-timezone/index.d.ts
undefined
undefined
Typescript Error
Cannot redeclare block-scoped variable 'tz'.
node_modules/angular-moment-timezone/node_modules/@types/moment-timezone/index.d.ts
undefined
undefined
I have no idea what I did wrong and I haven't found anything that can help so far. Has anyone else had this same issue?
We have the @types/moment-timezone
in our dependency which causes the error.
cannot redeclare block-scoped variable 'tz' moment-timezone
Since moment-timezone version 0.5.30
, d.ts files will be inside moment-timezone. You can save remove it
npm uninstall @types/moment-timezone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With