Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: __vite_ssr_import_3__.default after upgrading MUI from 5.14.20 to 5.15.13

When upgrading MUI from 5.14.20 to 5.15.13 I'm getting a type error from vite pointing at a particular MUI file, when run via npm run dev.

Stack Trace:

TypeError: __vite_ssr_import_3__.default is not a function
    at Module.createPalette [as default] (/Users/user/code/loculus/website/node_modules/@mui/material/styles/createPalette.js:251:34)
    at Module.createTheme [as default] (/Users/user/code/loculus/website/node_modules/@mui/material/styles/createTheme.js:27:32)
    at /Users/user/code/loculus/website/node_modules/@mui/material/styles/defaultTheme.js:4:33
    at async instantiateModule (file:///Users/user/code/loculus/website/node_modules/vite/dist/node/chunks/dep-jvB8WLp9.js:54897:9)

The error appears at the left paren after deepmerge on this line of the dependency (not my code):

const paletteOutput = deepmerge(_extends({
    // A collection of common colors.
    common: _extends({}, common),
    // prevent mutable object.
    // The palette mode, can be light or dark.
    mode,
    ...

I don't know what I'm doing wrong. I couldn't find any mention of breaking changes between 5.14.20 -> 5.15.13.

Unfortunately, I can't produce a minimal reproducible example, nor a bug report that mentions this issue. I'm using astrojs.

like image 712
Cornelius Roemer Avatar asked Jan 20 '26 12:01

Cornelius Roemer


1 Answers

Use client:only in your .astro file It helped for me

like image 130
Dmytro Herko Avatar answered Jan 23 '26 20:01

Dmytro Herko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!