Skip to content

Buffer is not defined in browser #49

@panick-carousel

Description

@panick-carousel

In this code file: https://github.com/paragonie/sodium-plus/blob/master/lib/keytypes/ed25519sk.js#L17 a reference is made to the global Buffer object.

When using in a browser bundler that does not shim nodejs builtins, like vite, this code fails.

The fix is importing from 'buffer' library, which is listed in the dependencies of sodium-plus.

Thank you for this super useful library too - makes life much easier !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions