Issue with Vite (Outdated optimize dep) #982
Unanswered
KirillRotanov
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Would you be able to fork the basic example in code sandbox, and provide your package.json and vite config to reproduce this error? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I don't know anything about this specific instance, but the
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, fellas!
I encountered a problem in my React TS Vite project,
the development of the MRT as a separate component was carried out in a storybook and there were no problems. But as soon as I decided to integrate the table into the application, I started getting strange errors:
or
I went here (mui/material-ui#31835) to find the solution, but all that i found it's to change the imports from " import Box from '@mui/material/Box' " to " import { Box } from '@mui/material' ".
Since i can't do it inside the MRT node module, I went to find another solution and found these branches on Vite's github (vitejs/vite#12434 vitejs/vite#8308) and ofcause a ton of questions on stackoverflow.
so I tried to change optimizeDeps option in vite.config.ts and in case of
optimizeDeps: {
include: ['@emotion/styled'],
exclude: [
'material-react-table',
],
}
I'm getting this error

in case of
optimizeDeps: {
include: ['@emotion/styled'],
exclude: [
'@mui/material',
],
}
getting this

Unfortunately none of the suggested solutions worked for me..
this change in vite.config.ts doesn't help:
build: {
target: 'esnext',
...other options,
}
also as
optimizeDeps: {
disabled: true
}
NOTE: I deleted and did reinstall to all the node_modules on each interaction with vite.config.ts and ran project with the --force flag
stack is:
"react": "18.2.0",
"vite": "5.0.12",
"material-react-table": "2.11.1",
"@mui/material": "5.15.9",
So I actually don't know what else I can try to fix this issue..
Will be very grateful for any help
Beta Was this translation helpful? Give feedback.
All reactions