Reproduction link or steps
Setup
Clone this repo
git clone https://github.com/dagda1/rolldown-mui-repro.git
pnpm install
pnpm build
pnpm start:frontend
Open the browser URL shown in the terminal http://localhost:3400/. The console will show:
Uncaught TypeError: Cannot read properties of undefined (reading 'muiName')
What is expected?
init_createSvgIcon should be called before createSvgIcon is available to consumers, ensuring SvgIcon is initialized.
What is actually happening?
The dep optimizer pre-bundles @mui/material into a shared chunk (utils-*.js). This chunk contains both createSvgIcon and its init function init_createSvgIcon.
The icon entry file (@mui_icons-material_KeyboardArrowDown.js) imports createSvgIcon and calls it immediately at module scope — but never imports or calls init_createSvgIcon. So SvgIcon is still undefined when createSvgIcon accesses SvgIcon.muiName.
System Info
System:
OS: macOS 26.3.1
CPU: (12) arm64 Apple M2 Max
Memory: 3.98 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 25.8.2 - /opt/homebrew/bin/node
Yarn: 4.0.0 - /Users/paulcowan/.volta/bin/yarn
npm: 11.11.1 - /opt/homebrew/bin/npm
pnpm: 10.33.0 - /Users/paulcowan/.volta/bin/pnpm
Deno: 2.2.1 - /Users/paulcowan/.deno/bin/deno
Browsers:
Chrome: 146.0.7680.165
Firefox: 122.0.1
Safari: 26.3.1
Any additional comments?
This worked until upgrading from vite 7 to vite 8
Reproduction link or steps
Setup
Clone this repo
Open the browser URL shown in the terminal http://localhost:3400/. The console will show:
What is expected?
init_createSvgIconshould be called beforecreateSvgIconis available to consumers, ensuringSvgIconis initialized.What is actually happening?
The dep optimizer pre-bundles
@mui/materialinto a shared chunk (utils-*.js). This chunk contains bothcreateSvgIconand its init functioninit_createSvgIcon.The icon entry file (
@mui_icons-material_KeyboardArrowDown.js) importscreateSvgIconand calls it immediately at module scope — but never imports or callsinit_createSvgIcon. SoSvgIconis stillundefinedwhencreateSvgIconaccessesSvgIcon.muiName.System Info
System: OS: macOS 26.3.1 CPU: (12) arm64 Apple M2 Max Memory: 3.98 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 25.8.2 - /opt/homebrew/bin/node Yarn: 4.0.0 - /Users/paulcowan/.volta/bin/yarn npm: 11.11.1 - /opt/homebrew/bin/npm pnpm: 10.33.0 - /Users/paulcowan/.volta/bin/pnpm Deno: 2.2.1 - /Users/paulcowan/.deno/bin/deno Browsers: Chrome: 146.0.7680.165 Firefox: 122.0.1 Safari: 26.3.1Any additional comments?
This worked until upgrading from
vite 7tovite 8