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
Having problems after upgrading to v4. #15898
Comments
This is very likely caused by your build setup. Can you share a minimal reproducible example? |
I have seen this class of error once last week, the resolution was to upgrade Next.js from v7 to v8: #15852. |
Somehow it fixed itself after uninstalling and installing Mui a few times. Closing this. |
I have the same Problem with Paper, Card and CircularProgress. I am using webpack 3, babel 6 and typescript 3.4.5 |
I'm having similar issues as well. Is there a part of our build config you would want to see? |
combing through the docs and upgrade guide to try to find a solution to this issue, i found reference to a we are not using next, so trying to upgrade that isn't an option we could try. |
the references to the styles provider are
the second reference includes this description, but the example only shows the
|
i did try adding the provider, guessing at the proper way to configure it, but did not see any behavioral change. this at least seems like a logical reason for the errors, but i'm not sure if i've configured it incorrectly or if it is simply not necessary |
unfortunately, no. we ended up shelving our upgrade and the changes that prompted us to attempt to upgrade so early. we attempted to go down the path of creating a minimal reproduction since our project is private, but had trouble finding what it was about our configuration that would reproduce the problem. instead, we're hoping that the problem will be identified more generally so we can better understand what details to look deeper into. |
@travi Do you get the exact same error that is included in the initial issue description? |
Yeah without any additional information about build setup (styles provider, core/styles or styles, used framework, ssr, prerender, csr etc) I can't help you much. |
one of the things that i had a hard time getting my head around was that the components where we saw the error all seemed to be using one piece that somewhat stood out to me toward the end, but i had spent so many hours digging that I didn't fully pursue, is that i could eliminate the error if i stopped rendering the lists of links that we render in a couple places (i had to remove all of them). we use react-router for navigation and are still using v3 of react-router to support some of the data-loading steps for SSR. in the button section of the migration guide i noticed the following statement:
followed by
i don't use refs enough to fully have my head around the implications but it did make me wonder if we somehow had something configured to put us in that situation and that maybe react-router v3's edit: wanted to provide the specific react-router version in case it does end up mattering. we are using v3.2.1, which is the latest of v3 |
the list of other things unique to our app is potentially long, which made it difficult to decide which pieces to invest in with a more minimal reproduction. the basic ones we tried didn't reproduce the problem. here is a short list that comes to mind:
|
Do they have a dependency on material-ui as well? Maybe you bundle multiple versions of material-ui Can you do a
It sounds like your setup was already broken before v4. If you can't resolve the issue with v4 I would start fixing the original issue. |
the package defines only a peer dependency on material. also, all dependencies coming from node_modules are excluded from the rollup bundle, expecting webpack to include them in the consuming application
we use npm rather than yarn, but i was inspecting pretty closely with
the problems we saw only came up once we tried to split our components package further. we've been successfully server-rendering with material for almost 3 years. i'm not sure what caused the classname mismatch with the additional split, but we found several issues that made it sound like there were known (at least very similar) issues due to the sequential nature of classname generation, even when providing |
one more detail that i forgot in my list above is that we do still load matertial v0 for some components, but that was confirmed to be still supported, but not recommended. we've been slowly trying to get the remaining ones upgraded, but since we are three years into this project, there are some deep in areas that we havent updated yet. also, we would need a solution to nested menus to fully transition and since there is still an open issue for official support, we've been watching that conversation to understand what the best path forward would be. |
since I'm using laravel, I created new laravel project (5.6) and tried material V4 there and did not get any errors. I replaced packages and versions in the main project package.json still have errors. this is packages which are the same in new and main project:
rest of the packages in main project:
I hope it help solve this issue... |
Could you do a A clonable repository would help a lot here. |
@eps1lon main project only diffrence is package.json |
Please create a minimal clonable repository with explicit steps to reproduce the issue. |
Adding the dependency |
will likely be a bit before i can try another attempt at upgrading, but based on the description of what that package is responsible for and this output from
thanks a ton for sharing @AnaBrade! |
Still getting this error even with the |
I'm also having the problem even by adding |
Before installing hoist-non-react-statics try to remove node_modules and install them again. |
It didn't help to remove node_modules before the installation. |
The issue was Next.js. It's required to update the Next.js as well. |
Still an issue for us. Next.js, hoist-non-react-statics, removed /styles and only re-installed /core - deleted node_modules... non of them helped. When trying the build with npm dev watch, I see an error with withstyle(undefined). What is wrong here. Any more thoughts? |
Ok. It turned out we were importing babel-polyfill twice ... one in the component and one in the entry through webpack to support es6. Hope this helps. |
in case it is helpful again, we did finally get back to attempting to upgrade and were successful after handling the hoisting problem with |
After upgrading to v4 I've been getting this error
It repeats itself 13 times for different Mui components Ive exported.
Ive tried degrading back to v3.9.3, like I used before but the problems persist so it might no be something intrinsic to v4.
The text was updated successfully, but these errors were encountered: