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

react refresh transform causes panic when used with a plugin which produces nodes with dummy spans #7471

Closed
thekip opened this issue May 30, 2023 · 1 comment · Fixed by #7514
Assignees
Labels
Milestone

Comments

@thekip
Copy link

thekip commented May 30, 2023

Describe the bug

Here is reproduction repo. https://github.com/behnamazimi/lingui-swc-plugin-issue-58

yarn && yarn dev then open a browser, or change the file.

It uses @lingui/swc-plugin which is transforming nodes and some nodes may have a Dummy Spans (because there are nothing to map to).
It seems that /swc_ecma_transforms_react-0.172.14/src/refresh/mod.rs is trying to process these nodes in some circumstances and doesn't expect to receive node without a source mapping.

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: DummyBytePos', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_transforms_react-0.172.14/src/refresh/mod.rs:159:74
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Input code

No response

Config

No response

Playground link

No response

Expected behavior

should not panic

Actual behavior

No response

Version

next@13.3.2

Additional context

No response

@swc-bot
Copy link
Collaborator

swc-bot commented Jul 13, 2023

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.

@swc-project swc-project locked as resolved and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants