-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot call a class constructor without |new| #5006
Labels
bug
Something isn't working
Comments
related to #4415 |
I believe I have the same issue using import axios from "axios"
import * as nock from "nock"
nock.load(filepathToPreviouslySavedNockRecording.json)
const bulbasaur = await axios({
method: "GET",
url: "https://pokeapi.co/api/v2/pokemon/bulbasaur"
}) I get: 519 | class OutgoingMessage extends Writable {
520 |
521 | constructor() {
^
TypeError: Cannot call a class constructor without |new|
at OutgoingMessage (node:http:521:26)
at new OverriddenClientRequest (/Users/rwhipple/Documents/study-bun/node_modules/nock/lib/intercept.js:279:4)
at /Users/rwhipple/Documents/study-bun/node_modules/nock/lib/intercept.js:427:13
at /Users/rwhipple/Documents/study-bun/node_modules/nock/lib/common.js:96:13
at /Users/rwhipple/Documents/study-bun/node_modules/follow-redirects/index.js:284:8
at new RedirectableRequest (/Users/rwhipple/Documents/study-bun/node_modules/follow-redirects/index.js:66:2)
at request (/Users/rwhipple/Documents/study-bun/node_modules/follow-redirects/index.js:523:13)
at /Users/rwhipple/Documents/study-bun/node_modules/axios/lib/adapters/http.js:438:10
at dispatchHttpRequest (/Users/rwhipple/Documents/study-bun/node_modules/axios/lib/adapters/http.js:149:54)
at /Users/rwhipple/Documents/study-bun/node_modules/axios/lib/adapters/http.js:143:4 |
+1 |
Related to #4787, seems to be the same underlying cause. |
konstfish
added a commit
to konstfish/bonsai
that referenced
this issue
Nov 12, 2023
I'm seeing the same issue using Inquirer.js. |
Can't repro this on 1.1.7 so I'm going to close this, if it's still relevant feel free to reopen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Bun is running?
1.0.0
What platform is your computer?
Darwin 22.3.0 arm64 arm
What steps can reproduce the bug?
What is the expected behavior?
❯ npx tsx cannot-call-a-class-constructor.ts
What do you see instead?
❯ bun run cannot-call-a-class-constructor.ts
Additional information
This code runs correctly using
npx tsx cannot-call-a-class-constructor.ts
The text was updated successfully, but these errors were encountered: