oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.47k stars 2.78k forks source link

Got ^14.4.5 (latest version) not working on bun 1.1.37 (latest version) #15477

Open pjlunardelli opened 19 hours ago

pjlunardelli commented 19 hours ago

What version of Bun is running?

1.1.37+8ca0eb831

What platform is your computer?

Darwin 24.1.0 arm64 arm

What steps can reproduce the bug?

Dependencies version:

"got": "^14.4.5",
"http2-wrapper": "2.2.1"

Run code bellow:

import got from "got";

await got("https://google.com.br", {
  http2: true,
});

What is the expected behavior?

Return response

What do you see instead?

113 |   }
114 | };
115 | 
116 | // This is basically inverted `closeCoveredSessions(...)`.
117 | const closeSessionIfCovered = (where, coveredSession) => {
118 |   for (let index = 0; index < where.length; index++) {
                                   ^
TypeError: undefined is not an object (evaluating 'where.length')
      at closeSessionIfCovered (/${OmittedForPrivacy}/node_modules/http2-wrapper/source/agent.js:118:30)
      at /${OmittedForPrivacy}/node_modules/http2-wrapper/source/agent.js:524:7
      at emit (node:events:73:22)
      at #onConnect (node:http2:2088:45)
      at onConnect (node:http2:2219:22)
550 |                                           return;
551 |                                           }
552 | 
553 |                                           // See https://github.com/nodejs/node/issues/38426
554 |                                           if (session.setLocalWindowSize) {
555 |                                           session.setLocalWindowSize(1024 * 1024 * 4); // 4 MB
                     ^
TypeError: this.#parser?.setLocalWindowSize is not a function. (In 'this.#parser?.setLocalWindowSize(windowSize)', 'this.#parser?.setLocalWindowSize' is undefined)
      at node:http2:2188:44
      at /${OmittedForPrivacy}/node_modules/http2-wrapper/source/agent.js:555:16
      at onceWrapper (node:events:165:55)
      at emit (node:events:73:22)
      at remoteSettings (node:http2:2012:49)

Additional information

No response

pjlunardelli commented 19 hours ago

When I run bunx tsx script.ts, it works as expected