-
Notifications
You must be signed in to change notification settings - Fork 292
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
Could not import the theme variables from another package (in a monorepo) #1108
Comments
Getting something very similar in our monorepo (Vanilla Extract component library -> Gatsby site). If we force the Gatsby site to use the package straight from the registry, rather than symlinked the issue goes away. |
@armandabric This could potentially be similar to #1043. TL;DR Exporting react components and styles from the same entrypoint causes issues with react refresh due to how it uses TitleCase names to detect components, and this might also be tripping up Remix. I tested this theory by removing all component exports from A common solution to this is to expose your styles in a separate entrypoint to your components. I tried to get this working but just adding a I also tried converting everything to |
Thanks to have take time to look into this. It makes more sense that's a bundling issue and not a Vanilla Extract one.
That's a good workaround, and in fact pretty it a logic things to do.
The reproduction repo use Remix v1. The ESM support got better in v2. |
Describe the bug
I'm building my design system in a dedicated package in a mono-repository. Everything was working perfectly until we try to use the theme variable in the main application (not only in the design system package).
The main application is a Remix application. In its
root.tsx
file I import my theme class (generated withcreateTheme()
)This is working.
The issue is when I trigger when I use the CSS variable of my theme:
I declare my theme like this:
My issue is that I could use the
acmeLegacyThemeClass
but not theAcmeLegacyVars
in my application.Am I doing something wrong?
Reproduction
https:/armandabric/vanilla-extract-import-vars-bug
System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: