paulmillr/noble-ciphers

The standalone file `noble-ciphers.js` is no longer available

Closed this issue · 6 comments

Is this intentional? As of 0.5.0 this file is not part of the release assets.
We've been using it to prototype some projects quickly and it's quite convenient for direct browser use. Is there an alternative?

just forgot to do it. ideally a github action would do it but not sure how to set it up https://github.com/paulmillr/noble-ciphers/releases/tag/0.5.1

Thank you. If you can share the exact way to build it, I can contribute an action to do it with a release trigger.

cd build; npm i; npm run build

Weird. I tried that, but I get this error which complains the path is not exported, even though it seems that it is. Might be my NPM version (10.2.4).

> npx esbuild --bundle input.js --outfile=noble-ciphers.js --global-name=nobleCiphers

✘ [ERROR] Could not resolve "@noble/ciphers/webcrypto/utils"

    input.js:6:28:
      6 │ import { randomBytes } from '@noble/ciphers/webcrypto/utils';
        ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The path "./webcrypto/utils" is not exported by package "@noble/ciphers":

    node_modules/@noble/ciphers/package.json:41:13:
      41 │   "exports": {
         ╵              ^

  You can mark the path "@noble/ciphers/webcrypto/utils" as external to exclude it from the bundle,
  which will remove this error.

Edit: It appears adding the following to package.json fixed it.

"./webcrypto/utils": {
      "types": "./webcrypto.d.ts",
      "import": "./esm/webcrypto.js",
      "default": "./webcrypto.js"
    }

fixed in d771ec0

Cheers, thanks for the quick response.