Skip to content
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

Error with @terascope/fetch-github-release #6309

Closed
robobun opened this issue Oct 5, 2023 · 1 comment
Closed

Error with @terascope/fetch-github-release #6309

robobun opened this issue Oct 5, 2023 · 1 comment

Comments

@robobun
Copy link

robobun commented Oct 5, 2023

Hi! I'm trying to use this module https://github.com/terascope/fetch-github-release but it just gives an error :(
Is something just not compatible with Bun yet? Or am I just stupid and didn't make it work properly?

Originally reported on Discord: Need help with Nodejs module on Bun

colinhacks added a commit that referenced this issue Oct 5, 2023
@colinhacks
Copy link
Contributor

Reproduction

const { downloadRelease } = require("@terascope/fetch-github-release");

const user = "colinhacks";
const repo = "zod";
const outputdir = "./downloads";
const leaveZipped = false;
const disableLogging = false;

// Define a function to filter releases.
function filterRelease(release) {
  // Filter out prereleases.
  return release.prerelease === false;
}

// Define a function to filter assets.
function filterAsset(asset) {
  // Select assets that contain the string 'windows'.
  return asset.name.includes("windows");
}

downloadRelease(
  user,
  repo,
  outputdir,
  filterRelease,
  filterAsset,
  leaveZipped,
  disableLogging
)
  .then(function () {
    console.log("All done!");
  })
  .catch(function (err) {
    // console.log(`ERROR`);
    console.log(err);
    console.error(err.message);
  });

Error

$ bun run fgr.ts     
121 |   connecting = !1;
122 |   timeout = 0;
123 |   isServer = !1;
124 |   #address;
125 | 
126 |   address() {
                     ^
TypeError: undefined is not an object
      at address (node:http:126:18)
      at node:http:164:38
      at ip (/Users/colinmcd94/Documents/bun/fun/node_modules/got/dist/source/core/index.js:1398:71)
      at /Users/colinmcd94/Documents/bun/fun/node_modules/got/dist/source/core/index.js:793:27
      at _onResponseBase (/Users/colinmcd94/Documents/bun/fun/node_modules/got/dist/source/core/index.js:778:26)
      at /Users/colinmcd94/Documents/bun/fun/node_modules/got/dist/source/core/index.js:948:18
      at _onResponse (/Users/colinmcd94/Documents/bun/fun/node_modules/got/dist/source/core/index.js:946:22)
      at /Users/colinmcd94/Documents/bun/fun/node_modules/got/dist/source/core/index.js:962:17
      at /Users/colinmcd94/Documents/bun/fun/node_modules/@szmarczak/http-timer/dist/source/index.js:43:19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants