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

Cloudflare workers are missing process.env #315

Open
jakubno opened this issue Feb 20, 2024 · 1 comment
Open

Cloudflare workers are missing process.env #315

jakubno opened this issue Feb 20, 2024 · 1 comment
Labels
bug Something isn't working sdk Improvements or additions to SDKs

Comments

@jakubno
Copy link
Member

jakubno commented Feb 20, 2024

Describe the bug
When running e2b sdk in cloudflare workers the sdk throws error because process isn't defined
image

@mlejva mlejva added the bug Something isn't working label Apr 4, 2024
@khalidx
Copy link

khalidx commented Jun 19, 2024

When running on Cloudflare Workers, e2b will likely need to use the env argument provided to the handler:

export default {
  async fetch(request, env, ctx) {
    return new Response(`API host: ${env.API_HOST}`);
  }
}

A polyfill for this is a better approach (or populating process.env based on the env argument). I'll take a look/stab at it!

@ValentaTomas ValentaTomas added the sdk Improvements or additions to SDKs label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sdk Improvements or additions to SDKs
Projects
None yet
Development

No branches or pull requests

4 participants