efficient-indigoE
Refine2y ago
17 replies
efficient-indigo

@refinedev/mui always throws an error during tests

When I'm writing tests with vitest and react testing library, as soon as I wrap a component with the refine provider it starts throwing this error. Does anyone know how to fix this?

Error: Directory import '/home/dev/software/services/marketplace/node_modules/.pnpm/@refinedev+mui@5.15.1_@emotion+react@11.11.4_@emotion+styled@11.11.5_@mui+lab@5.0.0-alpha.170_ap3fpruar6oljtcbusiih2zudm/node_modules/@mui/material/Box' is not supported resolving ES modules imported from /home/dev/software/services/marketplace/node_modules/.pnpm/@refinedev+mui@5.15.1_@emotion+react@11.11.4_@emotion+styled@11.11.5_@mui+lab@5.0.0-alpha.170_ap3fpruar6oljtcbusiih2zudm/node_modules/@refinedev/mui/dist/index.mjs
Did you mean to import "@mui/material/node/Box/index.js"?
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_UNSUPPORTED_DIR_IMPORT', url: 'file:///home/dev/software/services/marketplace/node_modules/.pnpm/@refinedev+mui@5.15.1_@emotion+react@11.11.4_@emotion+styled@11.11.5_@mui+lab@5.0.0-alpha.170_ap3fpruar6oljtcbusiih2zudm/node_modules/@mui/material/Box' }


I opened an issue because there doesn't seem to be any docs or examples on how to write tests https://github.com/refinedev/refine/issues/6020.
image.png
GitHub
A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility. - Issues · refinedev/refine
Issues · refinedev/refine
Was this page helpful?