-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Chakra UI doesn't work with ESM #6942
Comments
I'm facing the same problem here by using the vite-plugin-ssr. |
This is on chakras side. The exports configuration in the package.json is incorrect. |
It seems that Chakra is not compatible with Vite 4, see the vite issue above. Reverting to Vite 3 should fix this issue. |
The ESM issue has been resolved: chakra-ui/chakra-ui#6942
The ESM issue has been resolved: chakra-ui/chakra-ui#6942
Description
Copy from #6661 (comment) , I faced same issue.
Here is an example involving Vite (and thus Astro): https://stackblitz.com/edit/vitejs-vite-xfwglb?file=vite.config.ts
After running npm run build, starting the server with node dist/main.js will fail.
The reason is Chakra UI doesn't work with ESM yet. The following code is an example:
The root cause is mentioned in this comment: #6783 (comment). By renaming all esm.js to esm.mjs, I managed to get the code to run.
Link to Reproduction
https://stackblitz.com/edit/vitejs-vite-xfwglb?file=vite.config.ts
Chakra UI Version
2.3.5 & 2.3.7
Browser
Edge latest version
Operating System
The text was updated successfully, but these errors were encountered: