-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ipfs-http-client throws error when using in vite2 #3858
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
I'm not familiar with Vite. Are you running this in the renderer or the main process? Possibly related: |
Same error here, don't know how to fix it: yarn run v1.22.17
$ node scripts/watch.js
Pre-bundling dependencies:
vue
element-plus
ipfs-http-client
(this will be run only when your dependencies or config have changed)
✘ [ERROR] No matching export in "browser-external:url" for import "parse"
node_modules/electron-fetch/lib/index.es.js:1:9:
1 │ import { parse, format, resolve } from 'url';
╵ ~~~~~
✘ [ERROR] No matching export in "browser-external:url" for import "format"
node_modules/electron-fetch/lib/index.es.js:1:16:
1 │ import { parse, format, resolve } from 'url';
╵ ~~~~~~
✘ [ERROR] No matching export in "browser-external:url" for import "resolve"
node_modules/electron-fetch/lib/index.es.js:1:24:
1 │ import { parse, format, resolve } from 'url';
╵ ~~~~~~~
✘ [ERROR] No matching export in "browser-external:http" for import "STATUS_CODES"
node_modules/electron-fetch/lib/index.es.js:3:9:
3 │ import { STATUS_CODES } from 'http';
╵ ~~~~~~~~~~~~
Error: Build failed with 4 errors:
node_modules/electron-fetch/lib/index.es.js:1:9: ERROR: No matching export in "browser-external:url" for import "parse"
node_modules/electron-fetch/lib/index.es.js:1:16: ERROR: No matching export in "browser-external:url" for import "format"
node_modules/electron-fetch/lib/index.es.js:1:24: ERROR: No matching export in "browser-external:url" for import "resolve"
node_modules/electron-fetch/lib/index.es.js:3:9: ERROR: No matching export in "browser-external:http" for import "STATUS_CODES"
at failureErrorWithLog (/Users/yingshaoxo/CS/libgen2/node_modules/esbuild/lib/main.js:1602:15)
at /Users/yingshaoxo/CS/libgen2/node_modules/esbuild/lib/main.js:1248:28
at runOnEndCallbacks (/Users/yingshaoxo/CS/libgen2/node_modules/esbuild/lib/main.js:1033:63)
at buildResponseToResult (/Users/yingshaoxo/CS/libgen2/node_modules/esbuild/lib/main.js:1246:7)
at /Users/yingshaoxo/CS/libgen2/node_modules/esbuild/lib/main.js:1355:14
at /Users/yingshaoxo/CS/libgen2/node_modules/esbuild/lib/main.js:665:9
at handleIncomingPacket (/Users/yingshaoxo/CS/libgen2/node_modules/esbuild/lib/main.js:762:9)
at Socket.readFromStdout (/Users/yingshaoxo/CS/libgen2/node_modules/esbuild/lib/main.js:632:7)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12) {
errors: [
{
detail: undefined,
location: [Object],
notes: [],
pluginName: '',
text: 'No matching export in "browser-external:url" for import "parse"'
},
{
detail: undefined,
location: [Object],
notes: [],
pluginName: '',
text: 'No matching export in "browser-external:url" for import "format"'
},
{
detail: undefined,
location: [Object],
notes: [],
pluginName: '',
text: 'No matching export in "browser-external:url" for import "resolve"'
},
{
detail: undefined,
location: [Object],
notes: [],
pluginName: '',
text: 'No matching export in "browser-external:http" for import "STATUS_CODES"'
}
],
warnings: []
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. By the way, I'm using this electron template: https://github.com/cawa-93/vite-electron-builder And if you import this package |
ipfs-http-client^52.0.3

window 64-bit
the terminal throws this error when I run my project using the Vite
The text was updated successfully, but these errors were encountered: