Directory import `node_modules/@mui/material/Box` is not supported resolving ES modules imported from `node_modules/@refinedev/mui/dist/index.mjs`.
After extensive research, I found out that Node.JS doesn't support Directory imports. At least not yet. This is an issue with the latest release of the @refinedev/mui library. It imports Material UI components via directories.
This error was noticed when running tests using vitest in my application.
Steps To Reproduce
Setup a basic React application with Vite and install latest release of necessary dependencies for refine:
Setup standard configurations for vitest after installing vitest , @testing-library/dom, @testing-library/jest-dom, @testing-library/react, and @vitejs/plugin-react.
Create a basic test file. App.test.tsx
Run vitest and see the error in the terminal.
Expected behavior
I expected the tests to run properly. If there were no Directory imports in the node_modules/@refinedev/mui/dist/index.mjs file, there wouldn't have been an issue. A minor fix to move from directory imports to file imports will be good and following the standards set by Node.JS
Describe the bug
After extensive research, I found out that Node.JS doesn't support Directory imports. At least not yet. This is an issue with the latest release of the
@refinedev/mui
library. It imports Material UI components via directories.This error was noticed when running tests using vitest in my application.
Steps To Reproduce
vitest
,@testing-library/dom
,@testing-library/jest-dom
,@testing-library/react
, and@vitejs/plugin-react
.App.test.tsx
Expected behavior
I expected the tests to run properly. If there were no Directory imports in the
node_modules/@refinedev/mui/dist/index.mjs
file, there wouldn't have been an issue. A minor fix to move from directory imports to file imports will be good and following the standards set by Node.JSPackages
"@refinedev/core": "^4.51.0", "@refinedev/mui": "^5.17.0", "@refinedev/react-hook-form": "^4.8.20", "@refinedev/react-router-v6": "^4.5.11",
Additional Context
No response