#Astro: TypeError with @mui/material Button Import

3 messages · Page 1 of 1 (latest)

fallow rover
#

Astro MUI Error

TypeError: __vite_ssr_import_3__.default not a function

Trying to use @mui/material with Astro (v4.5.12). Button import seems correct, but encountering above error. Checked import syntax, typos, cache, config & versions. Any suggestions?

Code Snippet:

---
import { Button } from "@mui/material";
---
<Button>MUI Button</Button>

Full stack trace:

TypeError: __vite_ssr_import_3__.default is not a function
    at Module.createPalette [as default] (eval at instantiateModule (file:./node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:55003:28), <anonymous>:268:54)
    at Module.createTheme [as default] (eval at instantiateModule (file:./node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:55003:28), <anonymous>:42:48)
    at eval (eval at instantiateModule (file:./node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:55003:28), <anonymous>:7:51)
    at async instantiateModule (file:./node_modules/vite/dist/node/chunks/dep-C-KAszbv.js:55006:9)
cold vigil
wheat bridge
#

Make sure you both have the react integration installed since these are react components

If the react integration is already installed, try giving the component the client:only="react" directive