-
-
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
Theme is empty when importing component outside the Gatsby root #1479
Comments
Same history. I'm developing a project as monorepo.
when I import component from |
I'm having exactly the same issue trying to migrate to Emotion 10. I built a UI library with Emotion 9 that is used by two Gatsby sites. The library was compiled with Rollup and additionally exported a theme object which both sites imported for their Now with Emotion 10 the theme property received by the library components is empty. I've tried different combinations of emotion babel plugins/presets in my Rollup config as well as I would really appreciate some advice on how to implement an emotion-based ui library that uses themes. |
@lloydh @dmfilipenko I suspect that you have 2 copies of |
@Andarist Thank you, you were right. I just setup in my component library |
I have a monorepo setup as well and I've specified @lloydh are you still seeing the error? |
Have you checked your whole monorepo structure if there is only a single copy of |
@Andarist was basically on the money. While I had |
Seems like the issue has been diagnosed and the recommendation for a fix has been given - even though OP has not responded back if he has been able to get this working. |
I'm building a component library alongside a Gatsby demo website. The component library is styled with Emotion + theming.
Here is the basic folder structure I have:
My problem is that the button doesn't get the theme (the theme appears to be
{}
).However, if I move the button to
website/src/components
, the theme gets to the button as expected.See repro here.
What am I missing here?
The text was updated successfully, but these errors were encountered: