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鈥檒l 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. |
Duplicates
Latest version
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: