Immer: Error `Type 'Draft' is not generic.` on `ng build --prod`

Created on 15 Jan 2020  ยท  2Comments  ยท  Source: immerjs/immer

๐Ÿ› Bug Report

I installed immer 5.3.2 in my angular app
and when I build the application I got the following error
5.2.X works fine

Compiling TypeScript sources through ngc
ERROR: node_modules/immer/dist/types-external.d.ts(10,21): error TS2456: Type alias 'Draft' circularly references itself.
node_modules/immer/dist/types-external.d.ts(10,107): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(10,117): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(10,166): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(11,31): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(14,21): error TS2456: Type alias 'Immutable' circularly references itself.
node_modules/immer/dist/types-external.d.ts(14,119): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(14,133): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(14,194): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(15,30): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(48,135): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(50,134): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(50,163): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(52,16): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(62,135): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(64,134): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(64,163): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(66,16): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/immer.d.ts(41,27): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/immer.d.ts(41,91): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/index.d.ts(61,144): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/index.d.ts(68,49): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/index.d.ts(74,53): error TS2315: Type 'Immutable' is not generic.

An unhandled exception occurred: node_modules/immer/dist/types-external.d.ts(10,21): error TS2456: Type alias 'Draft' circularly references itself.
node_modules/immer/dist/types-external.d.ts(10,107): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(10,117): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(10,166): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(11,31): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(14,21): error TS2456: Type alias 'Immutable' circularly references itself.
node_modules/immer/dist/types-external.d.ts(14,119): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(14,133): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(14,194): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(15,30): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(48,135): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(50,134): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(50,163): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(52,16): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/types-external.d.ts(62,135): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(64,134): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(64,163): error TS2315: Type 'Immutable' is not generic.
node_modules/immer/dist/types-external.d.ts(66,16): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/immer.d.ts(41,27): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/immer.d.ts(41,91): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/index.d.ts(61,144): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/index.d.ts(68,49): error TS2315: Type 'Draft' is not generic.
node_modules/immer/dist/index.d.ts(74,53): error TS2315: Type 'Immutable' is not generic

To Reproduce

Steps to reproduce the behavior:

Any angular app that use immer
and then do ng build --prod

Most helpful comment

You will need TypeScript 3.7 to use Immer 5.3 and up

On Wed, Jan 15, 2020 at 4:09 PM daituzhang notifications@github.com wrote:

๐Ÿ› Bug Report

I installed immer 5.3.2 in my angular app
and when I build the application I got the following error
5.2.X works fine

Compiling TypeScript sources through ngc

ERROR: node_modules/immer/dist/types-external.d.ts(10,21): error TS2456: Type alias 'Draft' circularly references itself.

node_modules/immer/dist/types-external.d.ts(10,107): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(10,117): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(10,166): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(11,31): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(14,21): error TS2456: Type alias 'Immutable' circularly references itself.

node_modules/immer/dist/types-external.d.ts(14,119): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(14,133): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(14,194): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(15,30): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(48,135): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(50,134): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(50,163): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(52,16): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(62,135): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(64,134): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(64,163): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(66,16): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/immer.d.ts(41,27): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/immer.d.ts(41,91): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(61,144): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(68,49): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(74,53): error TS2315: Type 'Immutable' is not generic.

An unhandled exception occurred: node_modules/immer/dist/types-external.d.ts(10,21): error TS2456: Type alias 'Draft' circularly references itself.

node_modules/immer/dist/types-external.d.ts(10,107): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(10,117): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(10,166): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(11,31): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(14,21): error TS2456: Type alias 'Immutable' circularly references itself.

node_modules/immer/dist/types-external.d.ts(14,119): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(14,133): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(14,194): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(15,30): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(48,135): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(50,134): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(50,163): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(52,16): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(62,135): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(64,134): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(64,163): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(66,16): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/immer.d.ts(41,27): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/immer.d.ts(41,91): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(61,144): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(68,49): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(74,53): error TS2315: Type 'Immutable' is not generic

To Reproduce

Steps to reproduce the behavior:

Any angular app that use immer
and then do ng build --prod

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/immerjs/immer/issues/510?email_source=notifications&email_token=AAN4NBDBOLWF4KD26OEIMJTQ54YL7A5CNFSM4KHGAYFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IGMU27A,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAN4NBBPY3MNTQNOGEXTAGLQ54YL7ANCNFSM4KHGAYFA
.

All 2 comments

You will need TypeScript 3.7 to use Immer 5.3 and up

On Wed, Jan 15, 2020 at 4:09 PM daituzhang notifications@github.com wrote:

๐Ÿ› Bug Report

I installed immer 5.3.2 in my angular app
and when I build the application I got the following error
5.2.X works fine

Compiling TypeScript sources through ngc

ERROR: node_modules/immer/dist/types-external.d.ts(10,21): error TS2456: Type alias 'Draft' circularly references itself.

node_modules/immer/dist/types-external.d.ts(10,107): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(10,117): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(10,166): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(11,31): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(14,21): error TS2456: Type alias 'Immutable' circularly references itself.

node_modules/immer/dist/types-external.d.ts(14,119): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(14,133): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(14,194): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(15,30): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(48,135): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(50,134): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(50,163): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(52,16): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(62,135): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(64,134): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(64,163): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(66,16): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/immer.d.ts(41,27): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/immer.d.ts(41,91): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(61,144): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(68,49): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(74,53): error TS2315: Type 'Immutable' is not generic.

An unhandled exception occurred: node_modules/immer/dist/types-external.d.ts(10,21): error TS2456: Type alias 'Draft' circularly references itself.

node_modules/immer/dist/types-external.d.ts(10,107): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(10,117): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(10,166): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(11,31): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(14,21): error TS2456: Type alias 'Immutable' circularly references itself.

node_modules/immer/dist/types-external.d.ts(14,119): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(14,133): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(14,194): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(15,30): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(48,135): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(50,134): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(50,163): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(52,16): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/types-external.d.ts(62,135): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(64,134): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(64,163): error TS2315: Type 'Immutable' is not generic.

node_modules/immer/dist/types-external.d.ts(66,16): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/immer.d.ts(41,27): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/immer.d.ts(41,91): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(61,144): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(68,49): error TS2315: Type 'Draft' is not generic.

node_modules/immer/dist/index.d.ts(74,53): error TS2315: Type 'Immutable' is not generic

To Reproduce

Steps to reproduce the behavior:

Any angular app that use immer
and then do ng build --prod

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/immerjs/immer/issues/510?email_source=notifications&email_token=AAN4NBDBOLWF4KD26OEIMJTQ54YL7A5CNFSM4KHGAYFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IGMU27A,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAN4NBBPY3MNTQNOGEXTAGLQ54YL7ANCNFSM4KHGAYFA
.

@mweststrate, I lost my entire evening looking for it. I had completely forgotten to consider the typescript version. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Knacktus picture Knacktus  ยท  5Comments

yuanalexwu picture yuanalexwu  ยท  5Comments

steida picture steida  ยท  4Comments

cakoose picture cakoose  ยท  6Comments

CodingPapi picture CodingPapi  ยท  7Comments