e2b-dev / E2B

Secure open source cloud runtime for AI apps & AI agents
https://e2b.dev/docs
Apache License 2.0
6.6k stars 420 forks source link

Cloudflare workers are missing process.env #315

Open jakubno opened 6 months ago

jakubno commented 6 months ago

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

image
khalidx commented 2 months ago

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!