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
SWC generate wrong sourcemap when have mutibyte character after 1.3.20 #6552
Comments
IWANABETHATGUY
changed the title
SWC generate wrong position when have mutibyte character after 1.3.20
SWC generate wrong sourcemap when have mutibyte character after 1.3.20
Dec 1, 2022
So should we revert 47908a4? |
Can you check if it's the cause? |
Yeah, I could help |
The issue is gone after I revert that pr. |
This particular issue is caused by bug 2 in #6574. |
Thanks |
kdy1
pushed a commit
that referenced
this issue
Dec 4, 2022
**Description:** This fixes the BytePos -> CharPos calculation necessary for source maps. There were a few issues in the old code: 1. UTF-8 maps 1-3 bytes into 1 UTF-16 char, but 4 bytes into 2 UTF-16 chars 2. The starting offset was not recorded when we reached the end of the `multibyte_chars` iteration 3. The `mappings` can be unordered, meaning we need to restart the UTF-16 offset calculation **Related issue:** - Closes #6552.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Minimal reproduce repo
https://github.com/IWANABETHATGUY/swc-sourcemap-issue
How to reproduce
@swc/core 1.3.20
@swc/core 1.3.21
Input code
Config
Playground link
No response
Expected behavior
Should generate right source map
Actual behavior
No response
Version
@swc/core 1.3.21
Additional context
No response
The text was updated successfully, but these errors were encountered: