-
-
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
Various issues with MUI v6 Beta + Pigment + Remix #43380
Comments
Just to postscript the above with a big thank you to the maintainers for this great project which I love using and can't wait for the benefits this upgrade will bring 👍 |
Thank you for reporting all the issues! |
The fourth problem is probably connected to this issue I created in the Pigment CSS repo. |
I have same errors |
Getting same issues with |
With a similar config, on latest version ([email protected] and "@pigment-css/vite-plugin": "0.0.21"), I get : `[vite] Pre-transform error: @mui/material/FilledInput/FilledInput.js: Cannot convert undefined or null to object vite] Pre-transform error: @mui/material/OutlinedInput/OutlinedInput.js: Cannot convert undefined or null to object` |
Few updates while I try to fix this in dev. Let me know if you faces similar issues in production build as well -
|
Finally found the issue to be |
Thanks very much @brijeshb42, I'll take a look this morning and get back to you 👍 |
From my perspective all issues resolved (other than 6. perhaps pending a doc update). I've pushed fixes to my example repo. Many thanks for your efforts @brijeshb42 and co 👍 |
Closing this then. Feel free to re-open if facing related issue. |
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 @sdriffill-tm! How was your experience with our support team? |
Steps to reproduce
Link to live example:
forked repo branch
Current behavior
my theme options aren't being applied i.e. the primary/secondary/error colors are not being overridden
I'm getting browser console error
Warning: Prop dangerouslySetInnerHTML did not match
when running in devWhen running the prod build, the sx prop styles on my components aren't being applied due to style tags in the head taking precedence - these style tags have the attribute
data-emotion=...
I've not sure why there is anything to do with emotion going on since I've followed the steps to replace with pigment.If I add the
Stack
component to my app I get errorInternal server error: @pigment-css/react: You were trying to call "generateAtomics" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @pigment-css/vite-plugin for Vite integration or @pigment-css/nextjs-plugin for Next.js integration.
. See the_index.tsx
route for where I have commented out the use of this in my repo.Throwing a 500 error on the server causes several browser console errors and causes the app to render nothing. The first console error is:
chunk-Q5V2KV5S.js?v=b9511ac1:15014 Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. at StyleSheet2._insertTag (http://localhost:5174/node_modules/.vite/deps/chunk-MHCFHIPD.js?v=b9511ac1:40:23)
Visiting the "error" route demonstrates this problem
(minor) Getting linting error "Unknown property 'sx' found eslint(react/no-unknown-property)" - maybe worth adding something to the migration guide about adding an ignore clause to the relevant rule, similar to the existing section for adding it the typescript types.
Expected behavior
my theme options override the default
no error
emotion style tags not present
Stack component works and does not trigger an error
The error is handled by the
ErrorBoundary
defined in my root route, which displays the error with my customized styling from the theme options.(optional) addition to the docs
Context
I'm trying to upgrade a minimal template of Remix + Vite + MUI from v5 to v6 w/ pigment. I've followed the latest migration guides as well as implemented suggestions applied from this discussion where other users have had issues getting a working Remix template. Here is a summary of the changes made and the rationale:
Uninstalled emotion dependencies, installed pigment dependencies and upgraded MUI dependencies to the latest Beta version (as per migration guide)
Added a types file for TypeScript support (as per migration guide)
Added
import "@mui/material-pigment-css/styles.css";
to the top level of my app (the root route in Remix) (as per migration guide)Removed the
ThemeProvider
component from the top level of my app (as suggested here )Added pigment+config to my plugins in my vite config file. The pigment config includes:
extendTheme
methodtransformLibraries: ["@mui/material"]
(as suggested here and now in the migration guide)
Bundling MUI and pigment dependencies using the
ssr.noExternal
vite config option, due to CJS/ESM issues (as suggested in this example repo )Your environment
npx @mui/envinfo
I used Chrome Version 127.0.6533.120 (Official Build) (64-bit)
Search keywords: remix v6 pigment vite
The text was updated successfully, but these errors were encountered: