Astro v4 SSR - The requested module '@material-tailwind/react' is a CommonJS module #10644
Closed
1 task
Labels
- P2: nice to have
Not breaking anything but nice to have (priority)
pkg: react
Related to React (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
In Astro v3, importing components from '@material-tailwind/react' works fine for both SSR and CSR
Then on my Astro page:
In Astro v4, the above works fine for client side rendering only.
But if you try this in Astro v4 SSR, Vite will throw an error:
The error points to '@material-tailwind/react' being a CommonJS module. I read that Vite v5 requires ESM after v4, but why does it work with CSR?
For now I added this in my Astro config as a workaround:
What's the expected result?
Should work for both SSR and CSR
Link to Minimal Reproducible Example
CodeSandbox Link
Participation
The text was updated successfully, but these errors were encountered: