-
Notifications
You must be signed in to change notification settings - Fork 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
ThemeContext.Extend causing issue in production build with rollup and treeshake enabled #6602
Comments
Just hit this issue today in our project. Somehow importing |
Hey! Our team is also running into a similar issue. We currently can't use Grommet's ThemeContext due to rollup. Please share your findings. |
Is the suggested workaround: |
I just ran into this issue when building our app using vitejs. The workaround does still work. I played around and it also seems that if grommet's package.json was updated to include |
We also just encountered this issue after migrating our app from CRA to vitejs v4. We were not having any issues using CRA. The issue was only seen in prod builds.
This workaround also worked for us I think that #7122 is likely also related to this issue, even if they're not exact duplicates. I see there was some past history here with #2669 |
Expected Behavior
I want to be able to use
ThemeContext module
into my React application based on Grommet then build it with vite/rollup for production with treeshaking enabled.Actual Behavior
Currently, if I used
<ThemeContext.Extend />
into my application then I build it for production with vite/rollup, I get the following error :Identified workarounds
sideEffects
property into grommetpackage.json
file fix the issue 🤔URL, screen shot, or Codepen exhibiting the issue
A repository has been bootstrapped to reproduce the error
A related closed issue ThemeContext.Extend causing issues from CRA production build, possibly missing 💥 #2669
Steps to Reproduce
npx create-vite
)npm install grommet styled-components
)ThemeContext
module in yourmain
module<App />
within<ThemeContext.Extend>
npm run build
npm run preview
Your Environment
The text was updated successfully, but these errors were encountered: