The package may have incorrect main/module/exports specified in its package.json.
patolax opened this issue · comments
I get this error when I run npm run build. However, it generated code
[commonjs--resolver] Failed to resolve entry for package "C:\Users\myname\Desktop\icons\icon_lib\svg-icon-library-starter-main\dist\icons". The package may haverror during build: Error: Failed to resolve entry for package "C:\Users\myname\Desktop\icons\icon_lib\svg-icon-library-starter-main\dist\icons". The package may have incorrect main/module/exports specified in its package.json. ect main/module/exports specified in it at packageEntryFailure (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/vite/dist/node/chunks/dep-ca21228b.js:22005:11) js:22005:11) at resolvePackageEntry (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/vite/dist/node/chunks/dep-ca21228b. :5) js:22002:5) js:22002 at tryResolveFile (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/vite/dist/node/chunks/dep-ca21228b.js:21610:38) 610:38) ) at tryFsResolve (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/vite/dist/node/chunks/dep-ca21228b.js:21588:16) 8:16) 21430:28node-entry.js:24243:28) at Object.resolveId (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/vite/dist/node/chunks/dep-ca21228b.js: ync ModuleLoader.resolve21430:28) at as at file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/rollup/dist/es/shared/node-entry.js:24343:40 /shared/5) at async PluginDriver.hookFirstAndGetPlugin (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/rollup/dist/es 72:10) /shared/node-entry.js:24243:28) 87:26) at async resolveId (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/rollup/dist/es/shared/node-entry.js:231ntry.js:87:26) at async ModuleLoader.resolveId (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/rollup/dist/es/shared/node-entry.js:23451:15) 8b.js:79 at async Object.resolveId (file:///C:/Users/myname/Desktop/icons/icon_lib/svg-icon-library-starter-main/node_modules/vite/dist/node/chunks/dep-ca21228b.js:7972:10)
@patolax how have you resolved this?
add "module": "index.mjs" in "package.json" file