Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Cloudflare Workers #382

Open
Cretezy opened this issue Sep 26, 2023 · 0 comments
Open

Support Cloudflare Workers #382

Cretezy opened this issue Sep 26, 2023 · 0 comments

Comments

@Cretezy
Copy link

Cretezy commented Sep 26, 2023

When trying to run the SDK in Cloudflare Workers (which is not Node, but has some Node compatibility with node_compat), we get the following errors:

18:37:12.777 | ../node_modules/.pnpm/@linear+sdk@8.0.0/node_modules/@linear/sdk/dist/index-es.min.js:1:13: ERROR: Could not resolve "stream"
-- | --
18:37:12.777 | ../node_modules/.pnpm/@linear+sdk@8.0.0/node_modules/@linear/sdk/dist/index-es.min.js:1:35: ERROR: Could not resolve "http"
18:37:12.777 | ../node_modules/.pnpm/@linear+sdk@8.0.0/node_modules/@linear/sdk/dist/index-es.min.js:1:55: ERROR: Could not resolve "url"
18:37:12.777 | ../node_modules/.pnpm/@linear+sdk@8.0.0/node_modules/@linear/sdk/dist/index-es.min.js:1:74: ERROR: Could not resolve "https"
18:37:12.777 | ../node_modules/.pnpm/@linear+sdk@8.0.0/node_modules/@linear/sdk/dist/index-es.min.js:1:95: ERROR: Could not resolve "zlib"

Many of the packages are supported by Cloudflare Workers, but require a node: prefix. For example, crypto -> node:crypto.

I see that the following should be supported: stream, crypto. Others may need to be replaced or polyfilled.

https://developers.cloudflare.com/workers/runtime-apis/nodejs/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant