-
-
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
extractCritical does not seem to work when npm link
ing
#349
Comments
You need to be using the same instance of emotion. If you are linking then emotion-server is trying to link from its deps. Try linking emotion too(?) |
Ah, that might be it. Thanks for the quick response! What's the recommended pattern here, in that case? We were hoping to keep |
Also, any ideas why it needs to be the same instance of emotion? I thought it was mostly just a regex on the rendered HTML 🤔 |
Emotion has a mock stylesheet called |
I looked through your reproduction repo and couldn't figure out a way to make it work off the top of my head. Maybe @mitchellhamilton has some ideas. |
Thanks for taking a look @tkh44 , appreciated. Do you know if this changes at all in Emotion 8? |
@tizmagik Sadly, this won't change with emotion 8, the problem here is that the components package will always use its own version of emotion when linking since it'll be in its node_modules. I have one idea of a way to get around this, I wouldn't exactly say it's a very good solution but anyway, have a folder with a package.json with emotion and react-emotion as |
+1 for this issue. I'm currently rebuilding our component library and evaluating different CSS in JS libraries. Before I publish any changes to npm, I wanna test this out on a few of our different projects that use the component library - one of which being a server side rendering app. |
emotion
version: 7.3.2react
version: 16 (but also observed in latest 15.x)Relevant code.
What you did:
What happened:
npm link
ing a shared component repo (styled withemotion
) into a real app causesextractCritical
to not work (e.g.ids
andcss
are blank/empty)Reproduction:
https://github.com/tizmagik/emotion-link-repro
Problem description:
npm link
appears to break extractCriticalSuggested solution:
I'm not sure if it's actually a problem with
extractCritical
or just with my setup (likely the latter), but any pointers welcome!The text was updated successfully, but these errors were encountered: