-
Notifications
You must be signed in to change notification settings - Fork 698
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I tried using the @e2b/code-interpreter js sdk but is failing in type: module
To Reproduce
Steps to reproduce the behavior:
node version - v20.6.1
package version - 2.7.0
sample code snippet -
import { Sandbox } from '@e2b/code-interpreter'
const sbx = await Sandbox.create()
await sbx.runCode('x = 1')
const execution = await sbx.runCode('x+=1; x')
console.log(execution.text) // outputs 2
await sbx.terminate();
Error stack trace -
/Users/user/Desktop/nikhil/e2b_project/node_modules/e2b/dist/index.js:2455
var import_chalk = __toESM(require("chalk"));
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/user/Desktop/nikhil/e2b_project/node_modules/chalk/source/index.js from /Users/user/Desktop/nikhil/e2b_project/node_modules/e2b/dist/index.js not supported.
Instead change the require of /Users/user/Desktop/nikhil/e2b_project/node_modules/chalk/source/index.js in /Users/user/Desktop/nikhil/e2b_project/node_modules/e2b/dist/index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/Users/user/Desktop/nikhil/e2b_project/node_modules/e2b/dist/index.js:2455:28)
at Object.<anonymous> (/Users/user/Desktop/nikhil/e2b_project/node_modules/@e2b/code-interpreter/dist/index.js:62:25) {
code: 'ERR_REQUIRE_ESM'
}
A clear and concise description of what you expected to happen.
Browser console output
Console logs from your browser's developer tool console.
Terminal commands & output
Commands you used to start the app and the terminal output.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: macos
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working