import * as biscuitAuth from "npm:@biscuit-auth/biscuit-wasm@0.4.0";const root = new biscuitAuth.KeyPair();console.log(root);
import * as biscuitAuth from "npm:@biscuit-auth/biscuit-wasm@0.4.0";const root = new biscuitAuth.KeyPair();console.log(root);
However, I get the following error:
error: Unable to load ~/.cache/deno/npm/registry.npmjs.org/@biscuit-auth/biscuit-wasm/0.4.0/module/biscuit_bg.wasm imported from ~/.cache/deno/npm/registry.npmjs.org/@biscuit-auth/biscuit-wasm/0.4.0/module/biscuit.jsCaused by: stream did not contain valid UTF-8
error: Unable to load ~/.cache/deno/npm/registry.npmjs.org/@biscuit-auth/biscuit-wasm/0.4.0/module/biscuit_bg.wasm imported from ~/.cache/deno/npm/registry.npmjs.org/@biscuit-auth/biscuit-wasm/0.4.0/module/biscuit.jsCaused by: stream did not contain valid UTF-8
Separately, I also tried out the following in node js:
import { KeyPair } from '@biscuit-auth/biscuit-wasm';const root = new KeyPair();console.log(root);
import { KeyPair } from '@biscuit-auth/biscuit-wasm';const root = new KeyPair();console.log(root);
and ran it with
node --experimental-wasm-modules run.js
node --experimental-wasm-modules run.js
and it ran fine with no issues:
(node:11768) ExperimentalWarning: Importing WebAssembly modules is an experimental feature and might change at any time(Use `node --trace-warnings ...` to show where the warning was created)biscuit-wasm loadingKeyPair { ptr: 1539832 }
(node:11768) ExperimentalWarning: Importing WebAssembly modules is an experimental feature and might change at any time(Use `node --trace-warnings ...` to show where the warning was created)biscuit-wasm loadingKeyPair { ptr: 1539832 }
Could this be part of the solution? Does deno have a
--experimental-wasm-modules
--experimental-wasm-modules
or something similar that I need to use, or is this an issue with how Deno imports wasm packages from npm?