You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Astro v3, the documented way of importing works fine for both server side and client side rendering:
import { Button } from '@material-tailwind/react';
In Astro v4, the above works fine for client side rendering.
But if you try this in Astro v4 SSR, Vite will throw an error:
[vite] Named export 'Button' not found. The requested module '@material-tailwind/react' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@material-tailwind/react';
const {Button} = pkg;
We should be able to import material-tailwind components the same way for both SSR and CSR, so we can fully take advantage of Astro Islands concept.
The text was updated successfully, but these errors were encountered:
It seems Astro v4 SSR only supports ESM modules while material-tailwind still uses CommonJS. Thus the problem. Will you convert material-tailwind to use ESM instead? @sajadevo
In Astro v3, the documented way of importing works fine for both server side and client side rendering:
In Astro v4, the above works fine for client side rendering.
But if you try this in Astro v4 SSR, Vite will throw an error:
We should be able to import material-tailwind components the same way for both SSR and CSR, so we can fully take advantage of Astro Islands concept.
The text was updated successfully, but these errors were encountered: