-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popper.js:11 Uncaught TypeError: styled_default is not a function at Popper.js:11:20 #36515
Comments
I have this question too, when use vite |
The Popper runs well and does not complain about If it turns out to be a bug in our build, I'm happy to work on a fix, but I'm not familiar with Vite's bundler enough to figure it out. |
@michaldudak the point is we tried to create a minimal reproducible example. But it does not happen there. It even happens in our code intermittently. Sometimes it works. That's what made us submit our real code and strip away login and API calls only.\ Fortunately, the Vite team has already found the source of the bug using the same example repo. They have confirmed that it's a Vite bug, but I think you might also be able to add extra documentation to your docs. Because I've seen a lot of MUI developers suffer from this bug (related to |
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
export default defineConfig({
plugins: [react()],
optimizeDeps: {
include: [
'@mui/icons-material',
'@mui/material',
'@emotion/react',
'@emotion/styled',
],
},
}); Answer worked for me. |
Even though it may not necessarily look like it, we have reason to believe that the root cause of this issue actually lies in If you still run into issues after upgrading to >6.1.0, please open a new ticket, this will allow us to separate whatever problem is left from the rest of this ticket. Thank you for your patience. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note We value your feedback @Nefcanto! How was your experience with our support team? |
Steps to reproduce 🕹
Link to live example: https://github.com/Nefcanto/MuiPopperBug
Steps:
git clone https://github.com/Nefcanto/MuiPopperBug
cd MuiPopperBug
npm install
npm run dev
Current behavior 😯
Popper complains about
styled_default
and does not give us more information to debug this. All I see in my console is:And I see nothing in my terminal. I have no clue. None.
Expected behavior 🤔
When an error occurs, you should give us more data, at least a call stack that contains something related to our code.
What component of mine has caused this issue? What should I do to debug this?
In a real-world application with hundreds or sometimes thousands of components, it's impossible to go for trial and error.
Context 🔦
No response
Your environment 🌎
npx @mui/envinfo
I'm inside a docker container. My local browser is:
The text was updated successfully, but these errors were encountered: