E2B
E2B copied to clipboard
Support for Deno
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!");
});
`
);
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).
@mfrancis107 Our new beta SDK now supports Deno — https://e2b.dev/docs/guide/beta-migration