Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Could not resolve "a" for @virgilsecurity/e3kit-browser #59

Open
thecannabisapp opened this issue Aug 5, 2024 · 0 comments
Open

Comments

@thecannabisapp
Copy link

Trying to use @virgilsecurity/e3kit-browser with vite using this wasm plugin. Not sure if the problem is with the library I'm using which is https://github.com/VirgilSecurity/virgil-e3kit-js/ or with how I've configured the vite as I'm transitioning from Webpack 5 and React Rewired.

Here's a sandbox minimal reproduction: https://stackblitz.com/edit/vitejs-vite-jruc2f

> [email protected] dev
> vite


  VITE v5.3.5  ready in 2701 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
✘ [ERROR] Could not resolve "a"

    vite-plugin-wasm-namespace:/home/projects/vitejs-vite-jruc2f/node_modules/@virgilsecurity/e3kit-browser/dist/libpythia.browser.wasm:43:935:
      43 │ ... __vite__wasmImport_0_29, E as __vite__wasmImport_0_30 } from "a";~~~

  You can mark the path "a" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "a"

    vite-plugin-wasm-namespace:/home/projects/vitejs-vite-jruc2f/node_modules/@virgilsecurity/e3kit-browser/dist/libfoundation.browser.wasm:43:455:
      43 │ ... __vite__wasmImport_0_13, o as __vite__wasmImport_0_14 } from "a";~~~

  You can mark the path "a" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

Error: Build failed with 2 errors:
vite-plugin-wasm-namespace:/home/projects/vitejs-vite-jruc2f/node_modules/@virgilsecurity/e3kit-browser/dist/libfoundation.browser.wasm:43:455: ERROR: Could not resolve "a"
vite-plugin-wasm-namespace:/home/projects/vitejs-vite-jruc2f/node_modules/@virgilsecurity/e3kit-browser/dist/libpythia.browser.wasm:43:935: ERROR: Could not resolve "a"
    at failureErrorWithLog (/home/projects/vitejs-vite-jruc2f/node_modules/esbuild/lib/main.js:1462:15)
    at eval (/home/projects/vitejs-vite-jruc2f/node_modules/esbuild/lib/main.js:935:25)
    at eval (/home/projects/vitejs-vite-jruc2f/node_modules/esbuild/lib/main.js:1343:9) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}

Node.js 18.20.3

~/projects/vitejs-vite-jruc2f 10s
❯ vite

  VITE v5.3.5  ready in 2320 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
✘ [ERROR] Could not resolve "a"

    vite-plugin-wasm-namespace:/home/projects/vitejs-vite-jruc2f/node_modules/@virgilsecurity/e3kit-browser/dist/libpythia.browser.wasm:43:935:
      43 │ ... __vite__wasmImport_0_29, E as __vite__wasmImport_0_30 } from "a";~~~

  You can mark the path "a" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "a"

    vite-plugin-wasm-namespace:/home/projects/vitejs-vite-jruc2f/node_modules/@virgilsecurity/e3kit-browser/dist/libfoundation.browser.wasm:43:455:
      43 │ ... __vite__wasmImport_0_13, o as __vite__wasmImport_0_14 } from "a";~~~

  You can mark the path "a" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

Error: Build failed with 2 errors:
vite-plugin-wasm-namespace:/home/projects/vitejs-vite-jruc2f/node_modules/@virgilsecurity/e3kit-browser/dist/libfoundation.browser.wasm:43:455: ERROR: Could not resolve "a"
vite-plugin-wasm-namespace:/home/projects/vitejs-vite-jruc2f/node_modules/@virgilsecurity/e3kit-browser/dist/libpythia.browser.wasm:43:935: ERROR: Could not resolve "a"
    at failureErrorWithLog (/home/projects/vitejs-vite-jruc2f/node_modules/esbuild/lib/main.js:1462:15)
    at eval (/home/projects/vitejs-vite-jruc2f/node_modules/esbuild/lib/main.js:935:25)
    at eval (/home/projects/vitejs-vite-jruc2f/node_modules/esbuild/lib/main.js:1343:9) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}

Node.js 18.20.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant