E2B icon indicating copy to clipboard operation
E2B copied to clipboard

Support for Deno

Open mfrancis107 opened this issue 1 year ago • 1 comments

I would love to be able to use e2b through the Deno runtime.

When writing files I get an error when using Deno

Warning: Not implemented: ClientRequest.options.createConnection Warning: Not implemented: ClientRequest.options.createConnection Sandbox created Warning: Not implemented: ClientRequest.options.createConnection error: Uncaught (in promise) 'Awaiting response to "filesystem_write" with id: uPGYzUHzVcTC timed out.'

Here's an example Deno script

import { Sandbox } from "npm:@e2b/sdk";
import { load } from "https://deno.land/[email protected]/dotenv/mod.ts";

const env = await load();
const apiKey = env["E2B_API_KEY"];

const sandbox = await Sandbox.create({ apiKey });
console.log("Sandbox created");
await sandbox.filesystem.write(
  "/server.ts",
  `
Deno.serve((_request: Request) => {
  return new Response("Hello, world!");
});
`
);

mfrancis107 avatar Jan 12 '24 15:01 mfrancis107

Hi @mfrancis107! Thank you for opening this issue and I'm really glad you're interested in using E2B in Deno.

Unfortunately, we don't have enough time to dedicate adding support to Deno at the moment or going deep into what's the issue with our SDK when running it in Deno.

We'd be open to accepting a PR however (maybe even bounty if we find out enough users would be interested in using E2B in Deno).

mlejva avatar Jan 13 '24 09:01 mlejva

@mfrancis107 Our new beta SDK now supports Deno — https://e2b.dev/docs/guide/beta-migration

ValentaTomas avatar Jul 22 '24 21:07 ValentaTomas