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

[superagent] Fix Blob error #58312

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

alecgibson
Copy link
Contributor

@alecgibson alecgibson commented Jan 19, 2022

At the moment, some users' builds fail, because Blob isn't defined as
a global in Node.js - it sits in the buffer package.

This change adds an import from buffer to fix this issue.

Note that I think the build was incorrectly passing before because of
a leaky interface in stream/consumers.

Note that I've had to disable the linter's no-outside-dependencies
because of a known false positive on buffer.

Please fill in this template.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.

@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 19, 2022

@alecgibson Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 A DT maintainer needs to approve changes which affect module config files

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 58312,
  "author": "alecgibson",
  "headCommitOid": "1c53f4bcc24a7472e1c6d1072513d89b664b189b",
  "mergeBaseOid": "a997bedc49f992ce9ce9cb1d0d9360004809e48c",
  "lastPushDate": "2022-01-20T08:39:28.000Z",
  "lastActivityDate": "2022-01-20T08:44:47.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "superagent",
      "kind": "edit",
      "files": [
        {
          "path": "types/superagent/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/superagent/superagent-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/superagent/tslint.json",
          "kind": "package-meta",
          "suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-linter-tslintjson) and not moving towards it (check: `rules`)"
        }
      ],
      "owners": [
        "NicoZelaya",
        "mxl",
        "paplorinc",
        "shreyjain1994",
        "zopf",
        "beeequeue",
        "lukaselmer",
        "theQuazz",
        "carnesen",
        "ghostganz",
        "LuckyWindsck"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 1016373830,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Critical package Check Config Changes a module config files labels Jan 19, 2022
@typescript-bot
Copy link
Contributor

🔔 @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @BeeeQueue @lukaselmer @theQuazz @carnesen @ghostganz @LuckyWindsck — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Jan 19, 2022
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Jan 19, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Jan 19, 2022
@typescript-bot
Copy link
Contributor

@alecgibson The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

At the moment, some users' builds fail, because `Blob` isn't defined as
a global in Node.js - it sits in the [`buffer`][1] package.

This change adds an import from `buffer` to fix this issue.

Note that I think the build was incorrectly passing before because of
a [leaky interface in `stream/consumers`][2].

Note that I've had to disable the linter's `no-outside-dependencies`
because of a [known false positive on `buffer`][3].

[1]: https://nodejs.org/api/buffer.html#class-blob
[2]: DefinitelyTyped#55311 (comment)
[3]: microsoft/dtslint#315
@alecgibson
Copy link
Contributor Author

Does anyone smarter than me know why this is failing? I can't get it to fail locally, although I can't help but feel that it has something to do with my own PR 😬 #58270

@antongolub
Copy link
Contributor

antongolub commented Jan 20, 2022

@alecgibson,

microsoft/TypeScript#47507, #58277 (comment)

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Jan 20, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Jan 20, 2022
@DangerBotOSS
Copy link

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

superagent (unpkg)

was missing the following properties:

  1. Request
  2. Response
  3. protocols
  4. buffer

Generated by 🚫 dangerJS against 1c53f4b

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Jan 20, 2022
@gabritto gabritto merged commit 5fa7855 into DefinitelyTyped:master Jan 25, 2022
@typescript-bot typescript-bot removed this from Needs Maintainer Review in New Pull Request Status Board Jan 25, 2022
@alecgibson alecgibson deleted the superagent-blob branch January 26, 2022 08:10
@mariodu
Copy link

mariodu commented Jan 26, 2022

require('buffer').Blob is unavailable under v15.7.0.
https://nodejs.org/dist/latest-v16.x/docs/api/buffer.html#class-blob

should add engines in package.json

@alecgibson

@martin-badin
Copy link
Contributor

martin-badin commented Feb 6, 2022

require('buffer').Blob is unavailable under v15.7.0.

Blob is available from v14.18.0
https://nodejs.org/dist/latest-v14.x/docs/api/buffer.html#buffer_new_buffer_blob_sources_options

martin-badin pushed a commit to martin-badin/DefinitelyTyped that referenced this pull request Feb 23, 2022
At the moment, some users' builds fail, because `Blob` isn't defined as
a global in Node.js - it sits in the [`buffer`][1] package.

This change adds an import from `buffer` to fix this issue.

Note that I think the build was incorrectly passing before because of
a [leaky interface in `stream/consumers`][2].

Note that I've had to disable the linter's `no-outside-dependencies`
because of a [known false positive on `buffer`][3].

[1]: https://nodejs.org/api/buffer.html#class-blob
[2]: DefinitelyTyped#55311 (comment)
[3]: microsoft/dtslint#315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Check Config Changes a module config files Critical package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants