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

@iroha2/crypto-target-web doesn't work with Vite out of the box #104

Open
0x009922 opened this issue May 24, 2022 · 0 comments
Open

@iroha2/crypto-target-web doesn't work with Vite out of the box #104

0x009922 opened this issue May 24, 2022 · 0 comments
Labels

Comments

@0x009922
Copy link
Contributor

0x009922 commented May 24, 2022

Issue

This code fails in Vite:

import { init } from '@iroha2/crypto-target-web'

await init()

Reproduction

https://github.com/0x009922/iroha-js-sdk-issue-104-repro

It includes error details.

Workaround

Using ?url suffix:

import { init } from '@iroha2/crypto-target-web'
import WASM_URL from '@iroha2/crypto-target-web/wasm-pkg/iroha_crypto_bg.wasm?url'

init(WASM_URL).then(() => {/* ... */})
@0x009922 0x009922 changed the title @iroha2/crypto-target-web doesn't work with Vite with additional setup @iroha2/crypto-target-web doesn't work with Vite without an additional setup May 26, 2022
@0x009922 0x009922 changed the title @iroha2/crypto-target-web doesn't work with Vite without an additional setup @iroha2/crypto-target-web doesn't work with Vite out of the box May 26, 2022
@0x009922 0x009922 added has-workaround package: crypto Related to Crypto packages labels May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants