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

Deprecation: [@octokit/request-error] error.headers is deprecated, use error.response.headers. #2049

Closed
mijdavis2 opened this issue Aug 5, 2021 · 4 comments · Fixed by #2171 or #2202
Labels
bug Something isn't working released This issue/pull request has been released.

Comments

@mijdavis2
Copy link

Describe the bug

Any command now outputs the following:

Deprecation: [@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.

To Reproduce

  • Install auto
  • Run a command like auto changelog

Expected behavior

No deprecation warning

Screenshots

Environment information:

Environment Information:

"auto" version: v10.30.0
"git"  version: v2.30.2
"node" version: v14.17.0

Additional context

@mijdavis2 mijdavis2 added the bug Something isn't working label Aug 5, 2021
@hipstersmoothie
Copy link
Collaborator

I think this might be some deps that need updating. If anyone has the time to make these updates any and all PRs welcome!

@npvisual
Copy link

Note : I don't think that has been addressed as I am still seeing it in 10.36.5.

Is it possible to re-open the issue ?

The current warning is identical to the warning reported above.

% yarn --silent auto version
Deprecation: [@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.
    at RequestError.get (/Users/nicolasphilippe/Mperativ/GitHub/auto/node_modules/@octokit/core/node_modules/@octokit/request/node_modules/@octokit/request-error/dist-src/index.js:50:32)
    at /Users/nicolasphilippe/Mperativ/GitHub/auto/packages/core/src/git.ts:171:24
    at /Users/nicolasphilippe/Mperativ/GitHub/auto/node_modules/before-after-hook/lib/add.js:37:18
    at Git.getUserByUsername (/Users/nicolasphilippe/Mperativ/GitHub/auto/packages/core/src/git.ts:480:20)
minor
% yarn list --pattern auto
yarn list v1.22.18
warning package.json: No license field
warning No license field
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
├─ @auto-it/[email protected]
└─ [email protected]
✨  Done in 0.25s.

The problem seems to come from this statement in git.ts, since commenting that out will remove the warning :

    this.github.hook.error("request", (error) => {
      if (error) {
        // narrow down the type
        if ("headers" in error && error.request.headers.authorization) {
          delete error.request.headers.authorization;
          delete error.headers.authorization;                <-------- error.headers deprecated
        }
      }

The PR doesn't seem to modify this file at all.

I am not totally sure what the best course of action is here so please @hipstersmoothie advise.

@hipstersmoothie
Copy link
Collaborator

Could you open a pr?

poloagustin added a commit to poloagustin/auto that referenced this issue May 11, 2022
hipstersmoothie added a commit that referenced this issue May 20, 2022
…aders

fix(git): #2049 removes the use of deprecated error.headers
@intuit-svc
Copy link

🚀 Issue was released in v10.36.6 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released This issue/pull request has been released.
Projects
None yet
4 participants