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

[gatsby-source-filesystem] Deprecation warning #18433

Closed
rayriffy opened this issue Oct 10, 2019 · 17 comments · Fixed by #18857
Closed

[gatsby-source-filesystem] Deprecation warning #18433

rayriffy opened this issue Oct 10, 2019 · 17 comments · Fixed by #18857
Assignees
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@rayriffy
Copy link
Contributor

rayriffy commented Oct 10, 2019

Description

I got the deprecation warning from this plugin for Node 12 environment

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

Steps to reproduce

Just try to use gatsby-source-contentful

Environment


  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

@LekoArts LekoArts added type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change help wanted Issue with a clear description that the community can help with. labels Oct 17, 2019
@EnKrypt
Copy link
Contributor

EnKrypt commented Oct 19, 2019

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.

@EnKrypt EnKrypt self-assigned this Oct 19, 2019
@EnKrypt
Copy link
Contributor

EnKrypt commented Oct 19, 2019

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:

  • Wait for them (maybe we could help them speed things along), or
  • Switch to another package maybe?

Either way, I will try --trace-deprecation with node to confirm that I've managed to identify this problem correctly.

@EnKrypt
Copy link
Contributor

EnKrypt commented Oct 19, 2019

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?

@rayriffy
Copy link
Contributor Author

rayriffy commented Oct 20, 2019

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

@EnKrypt
Copy link
Contributor

EnKrypt commented Oct 20, 2019

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.

@EnKrypt
Copy link
Contributor

EnKrypt commented Oct 20, 2019

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.

@pieh
Copy link
Contributor

pieh commented Oct 22, 2019

See #18857 (comment) - we are blocked with getting rid of deprecation notice until we can safely bump one of dependency.

@rayriffy
Copy link
Contributor Author

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

@gatsbot
Copy link

gatsbot bot commented Nov 12, 2019

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’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. 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! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Nov 12, 2019
@gatsbot
Copy link

gatsbot bot commented Nov 23, 2019

Hey again!

It’s been 30 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 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!

@gatsbot gatsbot bot closed this as completed Nov 23, 2019
@LekoArts LekoArts reopened this Jan 13, 2020
@LekoArts LekoArts removed stale? Issue that may be closed soon due to the original author not responding any more. help wanted Issue with a clear description that the community can help with. labels Jan 13, 2020
@LekoArts LekoArts changed the title [gatsby-source-contentful] Deprecation warning [gatsby-source-filesystem] Deprecation warning Jan 13, 2020
@leymannx
Copy link

Getting the same on Node 13 when using the gatsby-source-drupal plugin.

@kubuntux
Copy link

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)

@styxlab
Copy link
Contributor

styxlab commented Mar 13, 2020

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.

@bogdansoare
Copy link

Same issue with Node 13

@EnKrypt
Copy link
Contributor

EnKrypt commented Mar 19, 2020

Followed up with other members in the org, and this now seems to be in the process of happening.

#22400

Once support for Node 8 is dropped, my PR above will be merged and this should be fixed.

@linardsb
Copy link

linardsb commented Apr 3, 2020

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?

@EnKrypt
Copy link
Contributor

EnKrypt commented Apr 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants