Skip to content

Cloudflare Worker support - avoid using 'crypto' from Node #121

Description

@Code6226

Just used wrangler locally to try the Cloudflare Worker support. I know a lot has been done recently to add support for non-Node JS environments.

Tried it at this commit from yesterday:
1c2e183

Here's the last thing I'm running into:

    src/util/server-sdk-js-main/dist/WebhookReceiver.js:1:19:
      1 │ import crypto from 'crypto';                       
        ╵                    ~~~~~~~~

  The package "crypto" wasn't found on the file system but is built into node.

They recommend the Web Crypto API: https://developers.cloudflare.com/workers/runtime-apis/web-crypto

After just commenting that code out locally, it was able to generate a JWT while running in wrangler - so I think this is the last thing left. Thanks!

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