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

26 views Asked by At

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.

0

There are 0 answers