Skip to content

Jose 6.x not working well with edge runtime #803

@ginkcode

Description

@ginkcode

What happened?

It keeps throwing this error.

"TypeError: Key for the RS256 algorithm must be one of type CryptoKey, KeyObject, or JSON Web Key. Received an instance of CryptoKey"

The same code working well with 5.10.0

Version

6.0.10

Runtime

Cloudflare Workers

Runtime Details

nodejs 20.19.0

Code to reproduce

jose
        .importX509(certKey, alg)
        .then((pub) => {
          // This function got error with jose version 6.x (edge runtime)
          let verifiedRes = jose.jwtVerify(token, pub);
          return verifiedRes;
        });

Required

  • I have searched the issues tracker and discussions for similar topics and couldn't find anything related.
  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions