gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.26k stars 10.31k forks source link

OutgoingMessage.prototype._headers is deprecated #29993

Closed precious-void closed 2 years ago

precious-void commented 3 years ago

Description

After migration to Gatsby 3, I'm experiencing this deprecation warning, but cannot find, which module is causing it.

verbose Transition to "runningQueries" > "calculatingDirtyQueries"
verbose Transition to "runningQueries" > "runningStaticQueries"
verbose Transition to "runningQueries" > "runningPageQueries"

 ERROR 

(node:28688) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

success run page queries - 0.867s - 2/2 2.31/s
verbose Transition to "runningQueries" > "waitingForJobs"
verbose Transition to "runningQueries" > "done"
verbose Transition to "startingDevServers"

Environment

  System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  Binaries:
    Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.9.1 - /c/Users/Artem Shteltser/AppData/Local/Programs/Python/Python39/python
  Browsers:
    Edge: Spartan (44.18362.449.0)
  npmPackages:
    gatsby: ^3.0.1 => 3.0.1
    gatsby-plugin-emotion: ^6.0.0 => 6.0.0
    gatsby-plugin-env-variables: ^2.0.0 => 2.0.0
    gatsby-plugin-eslint: ^3.0.0 => 3.0.0
    gatsby-plugin-google-fonts-v2: ^0.0.6 => 0.0.6
    gatsby-plugin-image: ^1.0.0 => 1.0.0
    gatsby-plugin-manifest: ^3.0.0 => 3.0.0
    gatsby-plugin-module-resolver: ^1.0.3 => 1.0.3
    gatsby-plugin-offline: ^4.0.0 => 4.0.0
    gatsby-plugin-portal: ^1.0.7 => 1.0.7
    gatsby-plugin-postcss: ^4.0.0 => 4.0.0
    gatsby-plugin-react-helmet: ^4.0.0 => 4.0.0
    gatsby-plugin-sharp: ^3.0.0 => 3.0.0
    gatsby-plugin-sitemap: ^3.0.0 => 3.0.0
    gatsby-source-filesystem: ^3.0.0 => 3.0.0
    gatsby-source-graphql: ^3.0.0 => 3.0.0
    gatsby-transformer-sharp: ^3.0.0 => 3.0.0
precious-void commented 3 years ago

Probably, similar issue as described here #25427 but on v3.

pieh commented 3 years ago

NODE_OPTIONS=--trace-deprecation gatsby develop should print stack trace that should help narrowing it down

precious-void commented 3 years ago

@pieh here is the full log:

 ERROR 

(node:22460) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
    at module.exports (C:\projects\onlixe\blog-insiders\insiders-template-react\node_modules\timed-out\index.js:9:17)  
    at EventEmitter.<anonymous>
(C:\projects\onlixe\blog-insiders\insiders-template-react\node_modules\got\index.js:244:5)
    at Object.onceWrapper (events.js:300:26)
    at EventEmitter.emit (events.js:210:5)
    at makeRequest
(C:\projects\onlixe\blog-insiders\insiders-template-react\node_modules\cacheable-request\src\index.js:94:9)
    at C:\projects\onlixe\blog-insiders\insiders-template-react\node_modules\cacheable-request\src\index.js:104:14     
    at runNextTicks (internal/process/task_queues.js:58:5)
    at processImmediate (internal/timers.js:412:9)
creotip commented 3 years ago

Have the same errors after updating to gatsby 3

wardpeet commented 3 years ago

@shtelzerartem yarn why timed-out should give you the package that uses timed-out, that's the culprit.

itsmeow commented 3 years ago
yarn why v1.22.4
[1/4] Why do we have the module "timed-out"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "timed-out@4.0.1"
info Reasons this module exists
   - "got" depends on it
   - Hoisted from "got#timed-out"
   - Hoisted from "gatsby-plugin-sharp#imagemin-mozjpeg#mozjpeg#bin-build#download#got#timed-out"
info Disk size without dependencies: "16KB"
info Disk size with unique dependencies: "16KB"
info Disk size with transitive dependencies: "16KB"
info Number of shared dependencies: 0
Done in 0.88s.
itsmeow commented 3 years ago
npm list timed-out
itsmeow.dev@1.0.0 C:\Users\itsmeow\Desktop\Development\js\itsmeow.dev
+-- gatsby@3.0.3
| `-- got@8.3.2
|   `-- timed-out@4.0.1
`-- gatsby-plugin-sharp@3.0.0
  `-- imagemin-mozjpeg@9.0.0
    `-- mozjpeg@7.0.0
      `-- bin-build@3.0.0
        `-- download@6.2.5
          `-- got@7.1.0
            `-- timed-out@4.0.1  deduped

Looks like old got versions, timed-out has been removed in newer versions of got. Not sure how this could be solved. This only started happening after I added some remote file nodes for sharp as shown in this guide.

precious-void commented 3 years ago

@wardpeet I have the same outputs as @itsmeow So yeah, it's related to got.

precious-void commented 3 years ago

@wardpeet @pieh any comments on this issue?

Daviidxo commented 3 years ago

As a workaround I did the following:

  1. yarn upgrade
  2. yarn add gatsby-plugin-sharp@3.1.0
  3. yarn add gatsby-source-filesystem@3.0.0

Until this issue is fixed I locked this two plugin's version and now the error disappeared.

shaurov commented 3 years ago

having the same issue here...!

Fetching Google Sheet [Function] 1ZGdsv0kXpAZQB0XM4APP9WX0iQUYqEq3Wjjp8fXnko8

 ERROR

(node:17740) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

i have also tried with migrated to...

  "gatsby-plugin-manifest": "^3.2.0",
  "gatsby-plugin-sharp": "3.1.0",
  "gatsby-source-filesystem": "3.0.0",

but that doesn't work for me.

my gatsby-node.js file:

const { createRemoteFileNode } = require(`gatsby-source-filesystem`)

exports.onCreateNode = async (
  {
    actions: { createNode },
    node,
    createContentDigest,
    store,
    cache,
    reporter,
  },
  { nodeName = `localFile` }
) => {
  if (
    node.internal.type === `googleMenuSheet` &&
    node.itemCategoryImage !== null
  ) {
    const fileNode = await createRemoteFileNode({
      url: node.itemCategoryImage,
      store,
      cache,
      createNode,
      createNodeId: createContentDigest,
      reporter,
    })

    if (fileNode) {
      const fileNodeLink = `${nodeName}___NODE`
      node[fileNodeLink] = fileNode.id
    }
  }
}
adrianopulz commented 3 years ago

The same issue here. The gatsby-plugin-sharp > Got > Time-Out is using the _headers deprecated method. The @Daviidxo solution is working for me until having a better solution.

shaurov commented 3 years ago

@KyleAMathews have some comments about this issue. thank you

shaurov commented 3 years ago

dear friends, raising the version of got solves the issue for me.

yarn add got@latest

thanks to this blog... https://kikunantoka.com/2021/03/15--migrate-from-gatsby-v2-to-gatsby-v3/

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

sallakos commented 3 years ago

This issue still persists with everything up to date.

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

dvdrtrgn commented 3 years ago

Following the tutorial at https://www.gatsbyjs.com/docs/tutorial/part-3/ and this:

(node:73478) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated (Use node --trace-deprecation ... to show where the warning was created)

is blocking progress. The result is malformed markup and this:

GET http://localhost:8000/static/8fe15b6557b8e11d33c198a6a9024136/de790/E1oMV3QVgAIr1NT.webp instead of https://pbs.twimg.com/media/E1oMV3QVgAIr1NT?format=jpg&name=large

LinnJS commented 3 years ago

Getting the same error when upgraded

image

spiraljacobs commented 3 years ago

Also getting this issue. Still showing up with latest versions of everything. This did fix it for now: npm install got@latest

Minneanimal commented 3 years ago

I ran into this issue while following the Gatsby v3 tutorial. Installing the latest got package also resolved the issue for me.

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

ThomasLaukkanen commented 3 years ago

dear friends, raising the version of got solves the issue for me.

yarn add got@latest

thanks to this blog... https://kikunantoka.com/2021/03/15--migrate-from-gatsby-v2-to-gatsby-v3/

This worked for me with this error: [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated Thank you so much!

Vacilando commented 3 years ago

npm install got@latest indeed fixes the problem but it's not a clean solution. "got" has to be upgraded in the plugin where it is defined as dependency.

jackzhujie commented 3 years ago

NODE_OPTIONS=--trace-deprecation gatsby develop should print stack trace that should help narrowing it down

i add the Environment variable in run app after, the error show in log4js package.

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

github-actions[bot] commented 2 years ago

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜