Skip to content

πŸ› Bug Report β€” Runtime APIs - nodejs compat - crypto - getRandomBytes()Β #2716

Closed
@petebacondarwin

Description

@petebacondarwin

The getRandomBytes() function will fail when called if it is not bound to the webcrypto object.
See cloudflare/workers-sdk#6721 for a test case.
Currently the calls fail with: TypeError: Illegal invocation: function called with incorrect this reference..

This has been fixed in unenv via unjs/unenv#309 but I think that the getRandomBytes() function should not require any particular this to work.

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