-
Notifications
You must be signed in to change notification settings - Fork 28k
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
[turbopack] emotion transform plugin drop config.import_map
needlessly
#71408
Comments
@l0gicgate The CodeSandbox refuses to load, not sure why. Is it possible to move the |
@samcx here is another CodeSandbox, I forked it again. Seems to work now: I have also made a GitHub repo: |
I tried using So it's an issue of import map. |
@kdy1 your codesandbox doesn't work. It throws an error just like mine. The weird thing is the |
I did something more after verifying it works. |
It's already fixed on |
@kdy1 you removed “—turbo” in the dev command in your branch. That’s not fixed. This should work with turbopack. Also, if there is a fix in Next 15 it should be ported to Next 14. |
It should work for turbopack, you're right. Reopening. next.js/turbopack/crates/turbopack-ecmascript-plugins/src/transform/emotion.rs Lines 62 to 79 in ca559a5
But backporting is another problem. |
config.import_map
needlessly
Thank you for reopening this @kdy1! Is there another way to apply the fix? I'm okay with doing manual config steps if necessary. |
So will that fix land in Next 14 at some point after #71776 is merged? |
@l0gicgate it won't land on 14 but will land on a 15 patch release. Turbopack on 14 was an early release 🙂 |
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Available memory (MB): 4102 Available CPU cores: 2 Binaries: Node: 20.11.1 npm: 10.2.4 Yarn: 1.22.19 pnpm: 8.15.4 Relevant Packages: next: 14.2.15 // Latest available version is detected (14.2.15). eslint-config-next: 14.2.1 react: 18.2.0 react-dom: 18.2.0 typescript: 5.4.5 Next.js Config: output: N/A
Which example does this report relate to?
with-emotion
What browser are you using? (if relevant)
Chrome Version 129.0.6668.90 (Official Build) (arm64)
How are you deploying your application? (if relevant)
Code Sandbox
Describe the Bug
Trying to use a component selector inside
css
function imported from@mui/material
or@mui/material/styles
:The following error is thrown:

I have also tried to add
importMap
to theemotion
property of thecompiler
option:Expected Behavior
It should work with Turbopack. It works with
next dev
but not withnext dev --turbo
To Reproduce
Here is a Code Sandbox with the reproduction:
https://codesandbox.io/p/devbox/zy4lww
Here is a GitHub repo with the reproduction
https://github.com/l0gicgate/nextjs-issue-71408
The text was updated successfully, but these errors were encountered: