🐛 Bug Report
There is a conflict between the global Iterator type introduced in immer v11.1.11 and the default Iterator type in TypeScript's ESNext lib.
The whole error:
node_modules/immer/dist/immer.d.ts:214:9 - error TS2403: Subsequent variable declarations must have the same type. Variable 'Iterator' must be of type 'IteratorConstructor', but here has type '{ from<T, TReturn>(iterable: Iterator<T, TReturn, any>): IterableIterator<T>; } | undefined'.
214 var Iterator: undefined | {
~~~~~~~~
node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.iterator.d.ts:145:9 - 'Iterator' was also declared here.
145 var Iterator: IteratorConstructor;
~~~~~~~~
Found 1 error in node_modules/immer/dist/immer.d.ts:214
Link to repro
https://github.com/OmniSliver/immerGlobalIterator
(I don't know how to run the TypeScript checker in codesandbox)
To Reproduce
Steps to reproduce the behavior:
Observed behavior
I get an error when running the TypeScript checker using the ESNext lib option
Expected behavior
To not get the error.
Environment
We only accept bug reports against the latest Immer version.
🐛 Bug Report
There is a conflict between the global Iterator type introduced in immer v11.1.11 and the default Iterator type in TypeScript's ESNext lib.
The whole error:
Link to repro
https://github.com/OmniSliver/immerGlobalIterator
(I don't know how to run the TypeScript checker in codesandbox)
To Reproduce
Steps to reproduce the behavior:
Observed behavior
I get an error when running the TypeScript checker using the ESNext lib option
Expected behavior
To not get the error.
Environment
We only accept bug reports against the latest Immer version.
setUseProxies(true)setUseProxies(false)(ES5 only)