Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

immer source filenames are missing from V5.1.0 sourcemaps #489

Closed
justingrant opened this issue Dec 23, 2019 · 1 comment · Fixed by #490
Closed

immer source filenames are missing from V5.1.0 sourcemaps #489

justingrant opened this issue Dec 23, 2019 · 1 comment · Fixed by #490
Labels

Comments

@justingrant
Copy link
Contributor

🐛 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:

{"version":3,"file":"immer.module.js","sources":["../node_modules/tslib/tslib.es6.js"],"sourcesContent":null,

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:

{"version":3,"file":"immer.module.js","sources":["../src/common.js","../src/scope.js","../src/es5.js","../src/proxy.js","../src/patches.js","../src/immer.js","../src/index.js"],"sourcesContent":null,

Environment

We only accept bug reports against the latest Immer version.

@aleclarson
Copy link
Member

🎉 This issue has been resolved in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants