-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
bugSomething isn't workingSomething isn't workingnode.jsCompatibility with Node.js APIsCompatibility with Node.js APIs
Description
What version of Bun is running?
1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a
What platform is your computer?
Darwin 22.5.0 arm64 arm
What steps can reproduce the bug?
Run bun initand add following code to index.ts.
const { input } = require("@inquirer/prompts");
const ask = async () => {
const answer = await input({ message: "Enter your name" });
console.log(answer);
return answer;
};
ask();
Run bun install @inquirer/prompts then run ```bun run index.ts````
You will get this error. It works when setting up the project as a node app
❯ bun run index.ts
? Enter your name
120 |
121 | class AsyncResource {
122 | type;
123 | #snapshot;
124 |
125 | constructor(type, options) {
^
TypeError: Cannot call a class constructor without |new|
at AsyncResource (node:async_hooks:125:26)
at run (/Users/christoph/Code/testing/inquirer/node_modules/@inquirer/core/dist/cjs/lib/hook-engine.js:96:13)
at workLoop (/Users/christoph/Code/testing/inquirer/node_modules/@inquirer/core/dist/cjs/lib/create-prompt.js:114:24)
at /Users/christoph/Code/testing/inquirer/node_modules/@inquirer/core/dist/cjs/lib/create-prompt.js:123:20
at processTicksAndRejections (:55:76)
What is the expected behavior?
Open a cli prompt and enable input
What do you see instead?
❯ bun run index.ts
? Enter your name
120 |
121 | class AsyncResource {
122 | type;
123 | #snapshot;
124 |
125 | constructor(type, options) {
^
TypeError: Cannot call a class constructor without |new|
at AsyncResource (node:async_hooks:125:26)
at run (/Users/christoph/Code/testing/inquirer/node_modules/@inquirer/core/dist/cjs/lib/hook-engine.js:96:13)
at workLoop (/Users/christoph/Code/testing/inquirer/node_modules/@inquirer/core/dist/cjs/lib/create-prompt.js:114:24)
at /Users/christoph/Code/testing/inquirer/node_modules/@inquirer/core/dist/cjs/lib/create-prompt.js:123:20
at processTicksAndRejections (:55:76)
Additional information
No response
bompi88, mokpi, iway1 and ncmbch
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingnode.jsCompatibility with Node.js APIsCompatibility with Node.js APIs