@Iconify/tools isnot compatible with vite-plugin-dynamic-import
Closed this issue · 7 comments
I use vite-plugin-dynamic-import in my Vue+Vite project. and also, the @iconify-vue is used. During the build of project, the following error appears:
'promises' is not exported by __vite-browser-external, imported by node_modules/@iconify/tools/lib/misc/scan.mjs
apparently , the @iconify/tool is not compatible with the plugin.
How can handle this issue?
You are probably using old version of Node or @types/node
Also that file should not be bundled. @iconify/tools
package is server only, not for bundles.
You are probably using old version of Node or
@types/node
I use latest version of both of them. It fails during build
Are you attempting to bundle it for browser?
Are you attempting to bundle it for browser?
I just run the command "npm run build" in Vite. It worked well, but when i used the vite-plugin-dynamic-import, this issue occured. Also, it has not any problems during runnnig 'npm run dev'
What environment are you bundling for? Node or browser?
That's a very important part. If you are building for browser, you can't do that because fs
is not available in browser. If you are building for Node, then its a bug in vite-plugin-dynamic-import
.
Yes, the vite-plugin-dynamic-import has bug when Vite using this plugin.
Thakns.