Skip to content
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

[BUG] - Serialized Error: { code: 'ERR_UNSUPPORTED_DIR_IMPORT' } #6086

Open
Gbolade-True opened this issue Jun 27, 2024 · 0 comments
Open

[BUG] - Serialized Error: { code: 'ERR_UNSUPPORTED_DIR_IMPORT' } #6086

Gbolade-True opened this issue Jun 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Gbolade-True
Copy link

Describe the bug

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

  1. Setup a basic React application with Vite and install latest release of necessary dependencies for refine:
"@refinedev/core": "^4.51.0",
"@refinedev/mui": "^5.17.0",
  1. Setup standard configurations for vitest after installing vitest , @testing-library/dom, @testing-library/jest-dom, @testing-library/react, and @vitejs/plugin-react.
  2. Create a basic test file. App.test.tsx
  3. 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

Packages

"@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

@Gbolade-True Gbolade-True added the bug Something isn't working label Jun 27, 2024
@Gbolade-True Gbolade-True changed the title Serialized Error: { code: 'ERR_UNSUPPORTED_DIR_IMPORT' } [BUG] - Serialized Error: { code: 'ERR_UNSUPPORTED_DIR_IMPORT' } Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant