styled-jsx transform infinite loop
@kdy1 is already working on this.
Since Aug 24, 2026.
Assessment
This issue has not been assessed yet.
Description
Describe the bug
There is an infinite loop when transforming this file with styled-jsx:
Minimal reproduction
Put
export const Probe = (props) => {
const t = props.theme;
const Icon = t.icon;
return (
<div className="probe">
<Icon />
<style jsx>{`
.probe {
color: ${t.color};
}
`}</style>
</div>
);
};
into packages/styled-jsx/transform/tests/fixture/class/input.js
Then you get
> Should transform class correctly
Error: Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
Snapshots 1 obsolete
↳ __tests__/wasm.test.ts
· Should transform class correctly 1
Test Files 1 failed (1)
Tests 1 failed | 2 passed | 78 skipped (81)
Start at 21:57:39
Duration 5.43s (transform 23ms, setup 0ms, collect 44ms, tests 5.23s, environment 0ms, prepare 35ms)
This is on commit a93bcc04a4bb2ff676865958db92d85fffd9823a
Expected behavior
It should be transformed and not timeout
Additional context
https://github.com/vercel/next.js/issues/97685
- Dominant language
- Rust
- Stars
- 389
- Forks
- 106
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from swc-project/plugins
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swc-project/plugins#655 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
swc-project/plugins#612 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
swc-project/plugins#610 · 1 reaction ·
-
swc-project/plugins#577 · 1 assignee ·
-
enhancement
swc-project/plugins#574 · 8 comments · 1 assignee ·
All issues in swc-project/plugins
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100