mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.91k stars 1.19k forks source link

webpack failing with unstable_generateUtilityClasses is not a function #9115

Closed pedaars closed 1 year ago

pedaars commented 1 year ago

Duplicates

Latest version

Steps to reproduce 🕹

Link to live example: I am unable to reproduce this outside of my company stack

Steps:

Using Chrome 113.0.5672.126

installed dataGrid from npm following the instructions here [https://mui.com/x/react-data-grid/getting-started/#installation]

copied the example given for dataGrid from the above link into my companies system

on running our app I get the following error Screenshot 2023-05-24 at 15 39 18

I also tried adding the example into our storybook but also receive the above error

Current behavior 😯

No response

Expected behavior 🤔

No response

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo ``` System: OS: macOS 13.3 Binaries: Node: 16.19.1 - ~/.nvm/versions/node/v16.19.1/bin/node Yarn: Not Found npm: 8.19.3 - ~/.nvm/versions/node/v16.19.1/bin/npm Browsers: Chrome: Not Found Edge: 113.0.1774.50 Firefox: 113.0.2 Safari: 16.4 npmPackages: @emotion/react: ^11.11.0 => 11.11.0 @emotion/styled: ^11.11.0 => 11.11.0 @mui/base: 5.0.0-beta.2 @mui/core-downloads-tracker: 5.13.2 @mui/envinfo: ^2.0.8 => 2.0.8 @mui/icons-material: 5.11.16 @mui/material: ^5.13.2 => 5.13.2 @mui/private-theming: 5.13.1 @mui/styled-engine: 5.13.2 @mui/styled-engine-sc: ^5.12.0 => 5.12.0 @mui/styles: ^5.13.2 => 5.13.2 @mui/system: 5.13.2 @mui/types: 7.2.4 @mui/utils: ^5.13.1 => 5.13.1 @mui/x-data-grid: 6.5.0 @mui/x-data-grid-generator: ^6.5.0 => 6.5.0 @mui/x-data-grid-premium: 6.5.0 @mui/x-data-grid-pro: ^6.5.0 => 6.5.0 @mui/x-license-pro: 6.0.4 @types/react: 17.0.37 react: ^17.0.2 => 17.0.2 react-dom: ^17.0.2 => 17.0.2 styled-components: ^5.3.10 => 5.3.10 typescript: 4.9.5 ```
cherniavskii commented 1 year ago

Hi @pedaars What version of @mui/material and @mui/system you are using?

pedaars commented 1 year ago

Hello @cherniavskii we are using

@mui/material = "version": "5.13.2", @mui/system = "version": "5.13.2",

cherniavskii commented 1 year ago

Thanks, I just noticed that you included your environment info 👍 I can see that the @mui/utils package (the one that exports unstable_generateUtilityClasses) is up to date:

@mui/utils: ^5.13.1 => 5.13.1 

And it definitely exports unstable_generateUtilityClasses - see https://unpkg.com/browse/@mui/utils@5.13.1/index.js

This is probably a bundling-related issue. We have seen this before in our demos in Codesandbox - https://github.com/mui/mui-x/issues/4924. But it wasn't reproducible outside of Codesandbox.

I cannot reproduce this issue locally with react-scripts. Do you use react-scripts for bundling?

pedaars commented 1 year ago

we use an internal (company) configuration with webpack for bundling

m4theushw commented 1 year ago

Could you check if there's another node_modules folder inside node_modules/@mui? You have the correct @mui/utils package but sometimes another dependency might be pulling an older version and you're ending with two versions installed.

pedaars commented 1 year ago

Screenshot 2023-05-25 at 18 19 05

no extra node_modules

m4theushw commented 1 year ago

Could you share the contents of yarn.lock or package-lock.json?

arvindkannan commented 1 year ago

Duplicates

  • [x] I have searched the existing issues

Latest version

  • [x] I have tested the latest version

Steps to reproduce 🕹

Link to live example: I am unable to reproduce this outside of my company stack

Steps:

Using Chrome 113.0.5672.126

installed dataGrid from npm following the instructions here [https://mui.com/x/react-data-grid/getting-started/#installation]

copied the example given for dataGrid from the above link into my companies system

on running our app I get the following error Screenshot 2023-05-24 at 15 39 18

I also tried adding the example into our storybook but also receive the above error

Current behavior 😯

No response

Expected behavior 🤔

No response

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo

I'm also getting similar error in latest version(6.5.0) of date-picker control as per MUI-X documentation. Working perfectly as expected in development(typescript) environment but the moment we will react.js and deploy the app crashes with below error message in console.

Not sure what's root cause of the issue but the moment I comment out the localization HOC and date picker the error vanishes in built version. Also identified by keeping LocalizationProvider and commenting out the Datepicker block also make it to work ,

image

cherniavskii commented 1 year ago

@arvindkannan This is not related to this issue, unless you see unstable_generateUtilityClasses is not a function error. Can you open a new issue with a reproduction example? Thanks!

github-actions[bot] commented 1 year ago

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.