Popper.js:11 Uncaught TypeError: styled_default is not a function at Popper.js:11:20
Problem
Describe the bug I have updated some of my dependencies. I expect to see the address of my code in the error call stack. All I see is this: [code block] I have also reported it to the MUI Team I have also seen that it's been asked here. My problem is that the error does not give us more information. Is it a Vite bug? Is it a bug related to esbuild? Is it a bug of MUI? I literally do not know. Reproduction https://github.com/Nefcanto/MuiPopperBug Steps to reproduce 1. `git clone https://github.com/Nefcanto/MuiPopperBug` 2. `cd MuiPopperBug` 3. `npm install` 4. `npm run dev` 5. Browse and see the error System Info [code block] Used Package Manager npm Logs _No response_ Validations - [X] Follow our Code of Conduct - [X] Read the Contributing Guidelines. - [X] Read the docs. - [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. - [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead. - [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server. - [X] The provided reproduction is a minimal reproducible example of the bug.
Error Output
Error: styled_default is not a function
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Popper.js:11 Uncaught TypeError: styled_default is not a function at Popper.js:11:20
So this comment is true on the aspects of this issue > It seems to be: > > 1. Related to using Vite. > 2. Intermittent, the problem comes and goes. > 3. Resolved (sometimes) by `pnpm prune` or removing `node_modules` folders 1. It is related to vite dep pre-bundle. It is a vite-only bug. 2. It is related how vite generate deps, big dep chunks are fine but small ones are problematic. Fresh clone
Trust Score
3 verifications
- 1
So this comment is true on the aspects of this issue
So this comment is true on the aspects of this issue
- 2
> It seems to be:
> > 1. Related to using Vite. > 2. Intermittent, the problem comes and goes. > 3. Resolved (sometimes) by `pnpm prune` or removing `node_modules` folders
- 3
It is related to vite dep pre-bundle. It is a vite-only bug.
2. It is related how vite generate deps, big dep chunks are fine but small ones are problematic. Fresh cloned repo seems to be efficient trigger vite small deps generation. 3. It touches `node_modules` and triggers vite to re-generate deps. Vite seems to be more likely to generate big dep chunks after the first generation. So when people installing/uninstalling deps, this issue tends to be "fixed".
Validation
Resolved in vitejs/vite GitHub issue #12423. Community reactions: 3 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep