You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, #467 isn't the only problem with sourcemaps in v5.1.0. A more serious problem is that the sourcemap doesn't actually map immer source files. In other words, the v5.1 sourcemap doesn't actually do anything because it doesn't refer to any source files except tslib... which isn't actually a runtime dependency!
The problem is that tsconfig.json needs to enable sourcemaps. I'm filing a PR shortly to fix this problem.
If you look at the rest of the 5.1.0 sourcemap file it's mostly blank, which is expected if there's no immer source files referenced there.
The user-facing result of the missing mappings is that original source won't be shown in debuggers like Chrome or VSCode. If users step into immer code, they'll be stepping into the transpiled JS, not the original TS code.
🐛 Bug Report
Unfortunately, #467 isn't the only problem with sourcemaps in v5.1.0. A more serious problem is that the sourcemap doesn't actually map immer source files. In other words, the v5.1 sourcemap doesn't actually do anything because it doesn't refer to any source files except tslib... which isn't actually a runtime dependency!
The problem is that tsconfig.json needs to enable sourcemaps. I'm filing a PR shortly to fix this problem.
Link to repro / To Reproduce / Observed behavior
Here's the beginning of the 5.1.0 (bad) sourcemap at https://unpkg.com/[email protected]/dist/immer.module.js.map:
If you look at the rest of the 5.1.0 sourcemap file it's mostly blank, which is expected if there's no immer source files referenced there.
The user-facing result of the missing mappings is that original source won't be shown in debuggers like Chrome or VSCode. If users step into immer code, they'll be stepping into the transpiled JS, not the original TS code.
Expected behavior
Here's the beginning of the (correct) 5.0.2 sourcemap at https://unpkg.com/[email protected]/dist/immer.module.js.map:
Environment
We only accept bug reports against the latest Immer version.
5.1.0
(although package.json still says5.1.0-beta.2
per package.json version (5.1.0-beta.2) doesn't match npm version (5.1.0) #488)setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: