Emotion SWC plugin improperly handled escape sequences
Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Wed Feb 19 06:37:35 UTC 2020
Binaries:
Node: 16.15.0
npm: 8.5.5
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.2.1-canary.2
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
N/A
How are you deploying your application? (if relevant)
N/A
Describe the Bug
With Emotion SWC enabled: the text of the escape sequence is rendered Without Emotion SWC enabled: the symbol is rendered properly
To toggle between the two, apply to next.config.js and restart the app.
+ emotion: false,
- emotion: {
- autoLabel: "never",
- sourceMap: true,
- },
Expected Behavior
In both situations, the symbol is properly rendered.
Note that the escape sequence \203A works as expected in both scenarios.
Link to reproduction
https://github.com/tills13/nextjs-emotion-escape
To Reproduce
Run
$ npm ci
$ npm run dev
Navigate to whatever URL nextjs outputs. You should see the escape sequence rendered as the text of the escape rather than as a symbol.
Please verify your issue reproduces with next@canary. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running npm install next@canary. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.
See https://github.com/emotion-js/emotion/issues/2802 for more discussion
The example repo uses the released version of Next but as noted in the next info output above I've verified it against next@canary
x-ref https://github.com/swc-project/swc/issues/5072 /cc @kdy1
Can you try a new version?
This should be fixed on canary
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.