immer icon indicating copy to clipboard operation
immer copied to clipboard

Typescript error in v1.5

Open Knacktus opened this issue 8 years ago • 5 comments

Just upgraded to version 1.5 in an Angular project. Compilation shows the following errors:

ERROR in node_modules/immer/dist/immer.d.ts(4,3): error TS1131: Property or signature expected. node_modules/immer/dist/immer.d.ts(4,25): error TS1005: ']' expected. node_modules/immer/dist/immer.d.ts(4,26): error TS1005: ';' expected. node_modules/immer/dist/immer.d.ts(4,27): error TS1128: Declaration or statement expected. node_modules/immer/dist/immer.d.ts(4,40): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(5,1): error TS1128: Declaration or statement expected. node_modules/immer/dist/immer.d.ts(8,5): error TS1005: ';' expected. node_modules/immer/dist/immer.d.ts(8,43): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(9,5): error TS1005: ',' expected. node_modules/immer/dist/immer.d.ts(9,32): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(9,56): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(10,5): error TS1005: ',' expected. node_modules/immer/dist/immer.d.ts(10,37): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(11,4): error TS1005: ')' expected.

Version 1.3.1 works fine.

Cheers,

Jan

Knacktus avatar Jul 25 '18 16:07 Knacktus

You need at least TS 2.8

Op wo 25 jul. 2018 18:00 schreef Knacktus [email protected]:

Just upgraded to version 1.5 in an Angular project. Compilation shows the following errors:

ERROR in node_modules/immer/dist/immer.d.ts(4,3): error TS1131: Property or signature expected. node_modules/immer/dist/immer.d.ts(4,25): error TS1005: ']' expected. node_modules/immer/dist/immer.d.ts(4,26): error TS1005: ';' expected. node_modules/immer/dist/immer.d.ts(4,27): error TS1128: Declaration or statement expected. node_modules/immer/dist/immer.d.ts(4,40): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(5,1): error TS1128: Declaration or statement expected. node_modules/immer/dist/immer.d.ts(8,5): error TS1005: ';' expected. node_modules/immer/dist/immer.d.ts(8,43): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(9,5): error TS1005: ',' expected. node_modules/immer/dist/immer.d.ts(9,32): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(9,56): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(10,5): error TS1005: ',' expected. node_modules/immer/dist/immer.d.ts(10,37): error TS1005: '(' expected. node_modules/immer/dist/immer.d.ts(11,4): error TS1005: ')' expected.

Version 1.3.1 works fine.

Cheers,

Jan

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mweststrate/immer/issues/171, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvGhEAN19WxyZbvR7lm29cBCi238K8Aks5uKJYUgaJpZM4VgW9k .

mweststrate avatar Jul 25 '18 16:07 mweststrate

Meanwhile Angular 6.1 with TS 2.9 was released. All working fine. You just need a little bit of luck :-) ... The issue can be closed. (Sorry, I don't know if and how I can close an issue here.)

Thanks!

Knacktus avatar Jul 26 '18 05:07 Knacktus

@mweststrate Thank you for great library... I also faced above issue... But my project is quite big includes couple of teams will not be able to upgrade typescript easily... So i went on using UMD

Do you have any other better suggestion in this case ? or is it fine ?

abidev avatar Jul 27 '18 15:07 abidev

@abidev you could grab the typings from the 1.4 version of the packages, and use patch-package to replace the latest typings with these older ones.

mweststrate avatar Aug 16 '18 14:08 mweststrate

@mweststrate Thank you... will try that...

abidev avatar Aug 21 '18 09:08 abidev