1
0

More than 3 years have passed since last update.

Gatsbyビルド時にOutgoingMessage.prototype._headers is deprecatedと怒られる件

Last updated at Posted at 2021-06-25

はじめに

こんにちは。名探偵コナンの99巻を買って2か月ほど経ちました。まだ読んでいません、筆者です :innocent:

さて、Gatsbyプロジェクトビルド時になんかエラーが出てたのでそれ対応した話です。
同じエラーが出て困っている方の参考になれば幸いです:pray:

エラーはこれ

$ gastby develop
...
...

ERROR 

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

廃止されたんすか:thinking:

ほんとだ...廃止されてた :innocent:

追記

上記リンク踏んで思ったのですが、アンカーリンクが期待通りの動きをしないので、ページ内を DEP0066 で検索して下さい:bow:

とりあえず助言通りオプション付けて実行してみた

$ node --trace-deprecation node_modules/gatsby/dist/bin/gatsby develop
...
...

ERROR 

(node:23379) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
    at module.exports (/home/workspace/node_modules/timed-out/index.js:9:17)
    at EventEmitter.<anonymous> (/home/workspace/node_modules/got/index.js:244:5)
    at Object.onceWrapper (node:events:476:26)
    at EventEmitter.emit (node:events:369:20)
    at makeRequest (/home/workspace/node_modules/cacheable-request/src/index.js:94:9)
    at /home/workspace/node_modules/cacheable-request/src/index.js:104:14
    at runNextTicks (node:internal/process/task_queues:59:5)
    at processImmediate (node:internal/timers:437:9)

お、gotさんが古そう :thinking:

最新のgotをインストールする

$ npm install got@latest

再度gatsby develpしてみる

エラーが出なくなった :v:

おわりに

こういう系ほったらかしにしがちですが、ぺちぺちやれば普通に直ってよかったです:pray:

本当はサイトマップが生成されなくなった原因を追ってて、ビルド時にエラーはいていたのを対応すれば出るようになると思ったのですが、全然関係なかったです :sweat:

でも少しすっきりしました!
それでは!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0