deep-jade
deep-jade2mo ago

why does this error occur?

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/node_modules/@mui/material/Box' is not supported resolving ES modules imported from /Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/node_modules/@refinedev/mui/dist/index.mjs
Did you mean to import @mui/material/node/Box/index.js?
at finalizeResolution (node:internal/modules/esm/resolve:249:11)
at moduleResolve (node:internal/modules/esm/resolve:908:10)
at defaultResolve (node:internal/modules/esm/resolve:1121:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_UNSUPPORTED_DIR_IMPORT',
url: 'file:///Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/node_modules/@mui/material/Box',
page: '/points'
}
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: ENOENT: no such file or directory, rename '/Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/.next/cache/webpack/client-development-fallback/0.pack.gz_' -> '/Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/.next/cache/webpack/client-development-fallback/0.pack.gz'
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/node_modules/@mui/material/Box' is not supported resolving ES modules imported from /Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/node_modules/@refinedev/mui/dist/index.mjs
Did you mean to import @mui/material/node/Box/index.js?
at finalizeResolution (node:internal/modules/esm/resolve:249:11)
at moduleResolve (node:internal/modules/esm/resolve:908:10)
at defaultResolve (node:internal/modules/esm/resolve:1121:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_UNSUPPORTED_DIR_IMPORT',
url: 'file:///Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/node_modules/@mui/material/Box',
page: '/points'
}
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: ENOENT: no such file or directory, rename '/Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/.next/cache/webpack/client-development-fallback/0.pack.gz_' -> '/Users/developer/Desktop/ftp/smile-subscription24-admin-v2/smile-subscription24-admin/.next/cache/webpack/client-development-fallback/0.pack.gz'
3 Replies
kapa.ai
kapa.ai2mo ago
Hi @florent. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The error message suggests that there's an issue with the way the '@mui/material/Box' module is being imported in your '@refinedev/mui/dist/index.mjs' file. However, without more context or information, it's hard to provide a definitive solution. It's worth noting that directory imports for ES modules are not supported, which is what the error message is indicating. You might need to adjust your import statement to point directly to the specific file you need, rather than the directory. For more information, you might find it helpful to review the Refine documentation (https://refine.dev/docs/getting-started/installation) or seek help from the Refine community (https://discord.com/channels/837692625737613362/1205453721228541972). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
like-gold
like-gold2mo ago
I'm having a similar issue
quickest-silver
quickest-silver2mo ago
Hey @florent, can you give more info about your project/environment? Are you using a CRA app?