I got the deprecation warning from this plugin for Node 12 environment
(node:72473) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
Just try to use gatsby-source-contentful
System:
OS: macOS 10.15
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.10.0 - /usr/local/bin/node
Yarn: 1.19.0 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
Languages:
Python: 3.7.4 - /Users/rayriffy/anaconda3/bin/python
Browsers:
Chrome: 77.0.3865.90
Safari: 13.0.2
Here is the documentation for this deprecation.
I believe a fix will involve finding the offending dependency and updating it to a later version (if the newer version of that package has switched to the proposed methods in the doc).
In the uncommon event that even the dependency has not yet fixed this deprecation notice, things might be murky, but I think we can handle it.
This warning comes from something using the http
module. That'll probably help narrow down which dependency it is. Right now, I'm not fully sure which one by just reading the dependency list. If anyone has any thoughts on this, feel free to comment.
I'm assigning myself to this issue, I hope that's cool with everyone.
Found the same issue on axios v0.19.0
which is being used by gatsby-source-contentful
as well.
My guess is that axios
is the culprit here (probably not even axios
but rather one of its dependencies again), and since they don't have a fix yet, we might have to either:
Either way, I will try --trace-deprecation
with node to confirm that I've managed to identify this problem correctly.
Strange. I actually cannot reproduce this warning message with the Using Contentful Gatsby Example.
@rayriffy can you update your packages and check if the warning still persists?
This warning is still being present in 2.1.50
. Maybe it coming from another plugin, I will update my gatsby info
below and deployment log can be found here and maybe here?
System:
OS: macOS 10.15
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.12.0 - /var/folders/2z/9k419rl576v4661nv0749crh0000gn/T/yarn--1571561649412-0.8930007235891473/node
Yarn: 1.19.1 - /var/folders/2z/9k419rl576v4661nv0749crh0000gn/T/yarn--1571561649412-0.8930007235891473/yarn
npm: 6.11.3 - /usr/local/bin/npm
Languages:
Python: 3.7.4 - /Users/rayriffy/anaconda3/bin/python
Browsers:
Chrome: 77.0.3865.120
Safari: 13.0.2
npmPackages:
gatsby: ^2.15.28 => 2.16.5
gatsby-image: ^2.2.29 => 2.2.29
gatsby-plugin-feed: ^2.3.15 => 2.3.19
gatsby-plugin-google-analytics: ^2.1.19 => 2.1.23
gatsby-plugin-manifest: ^2.2.20 => 2.2.23
gatsby-plugin-netlify: ^2.1.17 => 2.1.22
gatsby-plugin-netlify-cache: ^1.2.0 => 1.2.0
gatsby-plugin-react-helmet: ^3.1.10 => 3.1.13
gatsby-plugin-robots-txt: ^1.5.0 => 1.5.0
gatsby-plugin-sharp: ^2.2.31 => 2.2.32
gatsby-plugin-sitemap: ^2.2.16 => 2.2.19
gatsby-plugin-styled-components: ^3.1.8 => 3.1.11
gatsby-plugin-typescript: ^2.1.11 => 2.1.15
gatsby-plugin-typography: ^2.3.14 => 2.3.14
gatsby-remark-embed-gist: ^1.1.9 => 1.1.9
gatsby-remark-embed-spotify: ^2.0.2 => 2.0.2
gatsby-remark-embed-video: ^2.0.0 => 2.0.0
gatsby-remark-images-contentful: ^2.1.20 => 2.1.20
gatsby-remark-prismjs: ^3.3.20 => 3.3.20
gatsby-remark-responsive-iframe: ^2.2.25 => 2.2.25
gatsby-remark-smartypants: ^2.1.14 => 2.1.14
gatsby-source-contentful: ^2.1.50 => 2.1.50
gatsby-source-filesystem: ^2.1.28 => 2.1.33
gatsby-transformer-json: ^2.2.11 => 2.2.15
gatsby-transformer-remark: ^2.6.28 => 2.6.30
gatsby-transformer-sharp: ^2.2.19 => 2.2.23
Ok, I've managed to identify the conditions under which this can be reproduced.
This warning occurs only when downloadLocal
is set to true
in the plugin options for gatsby-source-contentful
in gatsby-config.js
.
This option is not set in the Gatsby provided example, so it does not show this warning there. The warning will also not show if there is nothing new to download from contentful in subsequent builds.
So the problem does exist in the current version of the plugin. I still think axios
is the culprit here as originally suspected. I'll probe more and try to get a definite answer.
Turns out the culprit was got
, which is a dependency of gatsby-source-filesystem
.
Discovering that was easy by tracing the deprecation warning's stack by running :
node --trace-deprecation node_modules/gatsby/dist/bin/gatsby build
The stack was as following :
(node:8880) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
at module.exports (C:\Users\EnKrypt\Downloads\gatsby\examples\using-contentful\node_modules\timed-out\index.js:9:17)
at get (C:\Users\EnKrypt\Downloads\gatsby\examples\using-contentful\node_modules\gatsby-source-filesystem\node_modules\got\index.js:115:4)
at Immediate.<anonymous> (C:\Users\EnKrypt\Downloads\gatsby\examples\using-contentful\node_modules\gatsby-source-filesystem\node_modules\got\index.js:124:3)
at processImmediate (internal/timers.js:439:21)
I'm going to spend some time making sure the tests are passing before making a pull request.
See https://github.com/gatsbyjs/gatsby/pull/18857#issuecomment-545040298 - we are blocked with getting rid of deprecation notice until we can safely bump one of dependency.
Don't worry, I can wait but I think it will be able to safely remove support for Node 8 now since it's not an active LTS
Hiya!
This issue has gone quiet. Spooky quiet. 馃懟
We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 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. You can also add the label "not stale" to keep this issue open!
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! 馃挭馃挏
Hey again!
It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.
Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY
. Please feel free to reopen 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!
Getting the same on Node 13 when using the gatsby-source-drupal
plugin.
Getting the same thing:
(node:5540) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
at module.exports (/Users/james/Projects/strapi/frontend/node_modules/timed-out/index.js:9:17)
at get (/Users/james/Projects/strapi/frontend/node_modules/got/index.js:115:4)
at Immediate.<anonymous> (/Users/james/Projects/strapi/frontend/node_modules/got/index.js:124:3)
at processImmediate (internal/timers.js:456:21)
Is there any chance to get this solved quickly? Issue is hitting me on Gatsby Cloud and it's been a couple of months now that it was decided to wait for other dependencies. Apparently the same issue is present in gatsby-transformer-sharp
.
Same issue with Node 13
Followed up with other members in the org, and this now seems to be in the process of happening.
https://github.com/gatsbyjs/gatsby/pull/22400
Once support for Node 8 is dropped, my PR above will be merged and this should be fixed.
hi,
got the same warning [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
when trying to start gatsby server gasby develop
. Downgraded node to 10, still the same. Is there any workaround for this?
I do believe the current release has my fix merged (not a full 100% sure), so if it is the same issue, you might want to update the version of gatsby and plugins in your project.
If that doesn't help, I recommend running the same trace command I've used above to find out the cause of the DeprecationWarning and opening a new issue perhaps.
Most helpful comment
Getting the same on Node 13 when using the
gatsby-source-drupal
plugin.