-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
TypeError: (0 , _capitalize.default) is not a function #22938
Comments
👋 Thanks for using Material-UI! We use GitHub issues exclusively as a bug and feature requests tracker, however, For support, please check out https://material-ui.com/getting-started/support/. Thanks! If you have a question on StackOverflow, you are welcome to link to it here, it might help others. |
@oliviertassinari This a potential bug with your helper function which capitalizes class names. Why do you consider this a QA? |
Because you're not able to reproduce this issue. We don't have the bandwidth to debug specifc app setups. A minimal reproducible example is a requirement for most issues. |
I'm having a similar issue with CheckBoxOutlineBlankOutlined. It appears to have something to do with Babel. The source map returns this:
When I set a breakpoint and run
The Material UI Icons |
Digging into this more, the source map I posted matched the contents of the "node_modules/@material-ui/icons/CheckBoxOutlineBlankOutlined.js" file. What is weird though is that the
The |
I find extremely weird, the problem persists. I didn't really dedicate time to investigate it for now, but I'll have to eventually soon. |
I dug into it even more last night. It has to do with the import statement. A dev build of webpack showed that the Material components are using the ESM versions, but the icons were being referenced as their CJS versions. What helped me fix it was finding issue #22433 about Rollup and icons. I was using |
On running jest tests locally, test suite fails when trying to mount the component with a ThemeProvider.
Current Behavior 😯
Currently running the local jest test suite fails to run because it fails on a compiled failed file.
Expected Behavior 🤔
Should run just fine
Steps to Reproduce 🕹
Unfortunately I cannot reproduce the issue on a repo.
I tried to reproduce the same behaviour in the sandbox but the behaviour doesn't reproduce.
See example here: https://codesandbox.io/s/fervent-nightingale-e7gg2?fontsize=14&hidenavigation=1&theme=dark
I'm using react-inl and @mui and in the test environment it just fails to compile. Complains about
_capitalize.default
not being a function, however I checked node_modules and the function is clearly there exported. Tried to re-install the packages as well just to make sure files are not corrupt.It seems the error is happening when trying to mount the element in the virtual dom to run some unit tests. Snapshot testing with shallow rendering works just fine.
**Dump of the error**
Context 🔦
Trying to run the tests locally and it just breaks when trying to mount things.
Your Environment 🌎
dump of npm ls
I'm aware I have some dep issues, but those are unrelated.
The text was updated successfully, but these errors were encountered: