E2B icon indicating copy to clipboard operation
E2B copied to clipboard

Cloudflare workers are missing process.env

Open jakubno opened this issue 1 year ago • 1 comments

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

jakubno avatar Feb 20 '24 04:02 jakubno

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!

khalidx avatar Jun 19 '24 19:06 khalidx