Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

ipfs-http-client throws error when using in vite2 #3858

Closed
Hahahahx opened this issue Sep 8, 2021 · 3 comments
Closed

ipfs-http-client throws error when using in vite2 #3858

Hahahahx opened this issue Sep 8, 2021 · 3 comments
Labels
need/author-input Needs input from the original author

Comments

@Hahahahx
Copy link

Hahahahx commented Sep 8, 2021

ipfs-http-client^52.0.3
window 64-bit
the terminal throws this error when I run my project using the Vite
image

@Hahahahx Hahahahx added the need/triage Needs initial labeling and prioritization label Sep 8, 2021
@welcome
Copy link

welcome bot commented Sep 8, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@achingbrain
Copy link
Member

@BigLep BigLep added need/author-input Needs input from the original author and removed need/triage Needs initial labeling and prioritization labels Sep 24, 2021
@lidel lidel closed this as completed Oct 1, 2021
@yingshaoxo
Copy link

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 import { create } from 'ipfs-http-client', you'll get the error I get.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/author-input Needs input from the original author
Projects
None yet
Development

No branches or pull requests

5 participants