Skip to content

Version 9.0.0 - sign function throws error on frontend (in browser) #863

@dawidreedsy

Description

@dawidreedsy

Description

When trying to use jsonwebtoken sign function on the frontend it throws error:

    TypeError: Right-hand side of 'instanceof' is not an object
        at module.exports [as sign] (webpack://@jwtcreator/creator/./node_modules/jsonwebtoken/sign.js?:109:58)

it looks like this is this if:

  if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject))

Reproduction

Just call sign function in the browser

Environment

"jsonwebtoken": "^9.0.0"
Chrome version: Version 108.0.5359.124 (Official Build) (arm64)

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