Is this library supposed to work in a browser? I'm hitting the below error in a fresh Vite app using v1.1.6.
Pre-bundling dependencies:
@peculiar/webcrypto
(this will be run only when your dependencies or config have changed)
> node_modules/@peculiar/webcrypto/build/webcrypto.es.js:7:17: error: No matching export in "browser-external:crypto" for import "createCipheriv"
7 │ import crypto, { createCipheriv, publicEncrypt, privateDecrypt, constants } from 'crypto';
╵ ~~~~~~~~~~~~~~
> node_modules/@peculiar/webcrypto/build/webcrypto.es.js:7:33: error: No matching export in "browser-external:crypto" for import "publicEncrypt"
7 │ import crypto, { createCipheriv, publicEncrypt, privateDecrypt, constants } from 'crypto';
╵ ~~~~~~~~~~~~~
> node_modules/@peculiar/webcrypto/build/webcrypto.es.js:7:48: error: No matching export in "browser-external:crypto" for import "privateDecrypt"
7 │ import crypto, { createCipheriv, publicEncrypt, privateDecrypt, constants } from 'crypto';
╵ ~~~~~~~~~~~~~~
> node_modules/@peculiar/webcrypto/build/webcrypto.es.js:7:64: error: No matching export in "browser-external:crypto" for import "constants"
7 │ import crypto, { createCipheriv, publicEncrypt, privateDecrypt, constants } from 'crypto';
╵ ~~~~~~~~~
> node_modules/@peculiar/webcrypto/build/webcrypto.es.js:8:9: error: No matching export in "browser-external:process" for import "version"
8 │ import { version } from 'process';
╵ ~~~~~~~
IIUC, the above error is because crypto and process are included as external node objects in rollup.config.js. Is there a missing shim for use in the browser?
Hello,
Is this library supposed to work in a browser? I'm hitting the below error in a fresh Vite app using
v1.1.6
.IIUC, the above error is because
crypto
andprocess
are included asexternal
node objects inrollup.config.js
. Is there a missing shim for use in the browser?