-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Node.js/Vite SSR: ERR_UNSUPPORTED_DIR_IMPORT with @mui/material/utils during Inertia.js SSR #45053
Comments
Please provide a repo that we can take a look and reproduce. |
Hey @absolutkarlos, I want to test if this is fixed by May I ask you to add this to your resolutions, install it, and try again?: "resolutions": {
"@mui/icons-material": "https://pkg.csb.dev/mui/material-ui/commit/3ed9f162/@mui/icons-material",
"@mui/material": "https://pkg.csb.dev/mui/material-ui/commit/3ed9f162/@mui/material",
"@mui/styled-engine": "https://pkg.csb.dev/mui/material-ui/commit/3ed9f162/@mui/styled-engine",
"@mui/styles": "https://pkg.csb.dev/mui/material-ui/commit/3ed9f162/@mui/styles",
"@mui/system": "https://pkg.csb.dev/mui/material-ui/commit/3ed9f162/@mui/system",
"@mui/types": "https://pkg.csb.dev/mui/material-ui/commit/3ed9f162/@mui/types",
"@mui/utils": "https://pkg.csb.dev/mui/material-ui/commit/3ed9f162/@mui/utils",
}, Note: This is just to test, these builds are not production ready. |
Hi everyone, @siriwatknp I've rolled back the project to a stable version due to an Inertia SSR misconfiguration. We're using CSR for now. I'll investigate the SSR issue further. Thanks, |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @absolutkarlos How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
I'm encountering an ERR_UNSUPPORTED_DIR_IMPORT error during server-side rendering (SSR) with Vite, React, MUI (Material UI), and Inertia.js. The specific error message is:
This error only occurs during the SSR process (php artisan inertia:start-ssr). The client-side build works fine.
Problem Context:
I'm using the following technologies:
Laravel: 11.38.2
Inertia.js: 2.0.0
React: 19.0.0
MUI (Material UI): 6.4.0
Vite: 6.0.7
Node.js: 22.13.0
npm: 10.9.2
What I've Tried:
Corrected
config/inertia.php
: I've ensured that thebundle
path in myconfig/inertia.php
file correctly points to the SSR bundle generated by Vite (which is now inbootstrap/ssr/ssr.js
):noExternal
Configuration: I've added the relevant MUI packages, lexical packages, react packages and@inertiajs/server
to thessr.noExternal
array in myvite.config.js
:Clean Install: I've tried removing
node_modules
,package-lock.json
, clearing the npm cache, and reinstalling dependencies.Updated MUI: I have updated MUI to the latest version.
Corrected imports in
ssr.jsx
: I have checked my imports in the ssr.jsx file.verified vite config output and ssr output: I have verified the output of the vite config, and the ssr output directory.
Relevant Code Snippets:
vite.config.js
:config/inertia.php
:resources/js/ssr.jsx
:Expected Behavior:
I expect the SSR server to start without any
ERR_UNSUPPORTED_DIR_IMPORT
errors.Actual Behavior:
The
ERR_UNSUPPORTED_DIR_IMPORT
error persists, preventing the SSR server from starting.Question:
How can I resolve the
ERR_UNSUPPORTED_DIR_IMPORT
error with@mui/material/utils
during Vite SSR with Inertia.js? Is there a specific configuration or workaround needed to handle MUI's internal module resolution in this context?Search keywords:
The text was updated successfully, but these errors were encountered: