-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Component selectors not working with @emotion/babel-preset-css-prop
#1346
Comments
I have the same issue, but with |
@mitchellhamilton @tkh44 (and other maintainers I've missed). I want to thank you all for the incredible work you guys do in making this incredible package! Emotion has been a blessing for my team. On the topic of this issue, I'm sure you all are busy and so I'm happy to contribute. I'm not too familiar with the codebase, however. Would someone be able to give me some guidance on beginning to fix this? |
I think I solved the problem on my end. I changed my tsconfig, to use {
"module": "esnext",
"moduleResolution": "node"
} And let Babel handle the transpilation of module imports. |
That's actually already what I had in my settings so no luck for me unfortunately. :( |
@IsenrichO Your repro is using CRA (codesandbox.io uses its config) - that means that the babelrc you have created there is not even loaded because CRA doesn't support babel config customization. Once I've made this babelrc being loaded (by tweaking node_modules contents - I've removed this) it has started to work. |
Ahh interesting. Thank you @Andarist, that's information I didn't realize. I'm not sure how to edit the CodeSandbox to not apply create-react-app under the hood so I'm not able to easily update my repro to better match the actual environment of my application where I encounter the problem. However, I do have a different suspicion about why I still have the issue in my app (under GH enterprise, so I can't easily share it unfortunately). We don't use CRA there. Our app uses Lerna where we have a main Do you think that importing this custom |
Yes, that's the most probable problem - there is an open PR which will help you once it gets merged in: #1220 . There is not ETA for this yet though. |
Closing this right now - because the mentioned #1220 is supposed to fix this and I will be working this month to land this. It will be a part of the upcoming v11 release. |
Nice. Can't wait. |
Tks that worked for me. |
@emotion/core
version:^10.0.10
@emotion/styled
version:^10.0.11
@emotion/babel-preset-css-prop
version:^10.0.9
react
version:^16.8.4
Relevant code:
What you did:
First off, thank you all for your tireless work on the emotion library. It's an excellent set of packages!
In trying to complete the upgrade to emotion v10 in a private codebase. I'm mostly there except for one key issue that I've run into. Namely, component selectors don't seem to be supported when using
@emotion/babel-preset-css-prop
.It may be relevant to include that I'm also working in a TypeScript project.
What happened:
Error is thrown. Error message reads:
This is an unexpected error because I am using
@emotion/babel-preset-css-prop
which already usesbabel-plugin-emotion
under the hood.Reproduction:
Link to repro
Suggested solution:
Not familiar enough with emotion codebase to recommend a solution but happy to take a crack at it.
The text was updated successfully, but these errors were encountered: