Skip to content

encodeHex does not work on the web

NIP98.ts and blossomUploader.ts use import { encodeHex } from '@std/encoding/hex';

If my understanding about deno is correct, it is not possible to import @std/encoding/hex when running in the browser.

As the documentation says nostrify is for deno and the web, I suppose encodeHex should use a more generic encoder implementation.

As a result running yarn dev in soapbox dir (using the latest nostrify) results in an error:

✘ [ERROR] Could not resolve "@std/encoding/hex"

    node_modules/@nostrify/nostrify/dist/NIP98.js:1:26:
      1 │ import { encodeHex } from '@std/encoding/hex';
        ╵                           ~~~~~~~~~~~~~~~~~~~

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