LoginSignup
3
0

More than 1 year has passed since last update.

GatsbyJSにいれたnode16系で[DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at ...と怒られたのでその対応

Last updated at Posted at 2021-06-18

結論から言うと node15系(15.14.0)にしぶしぶ変更してエラーが消えました。
※追記:gatsby-cloudを使ってビルドしている場合は現在node14までしか使えないためアプデするなら14系の方が良いかもしれません。

node12系からnode16系へバージョンアップさせる流れでぶち当たりました。(gatsbyのバージョンは3.7.2)

エラー内容ですが

[DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at
/Users/省略/package.json.
Update this package.json to use a subpath pattern like "./*".

ということで package.jsonで ./ となっているところを探したもののすでに ./* となっておりそこが問題ではありませんでした。

色々探してみると postCSS のバージョンが古いことが問題のようです。この記事を見ている頃には解決されているかもしれません。
しかしpostCSSの最新バージョンをインストールしましたがダメでした。

また、gatsbyプラグイン各種を最新アップさせたり、package.jsonにexportのJSONを追記してみたりしたものの解決できず。
node_modulesを再インストールも虚しく解決することができませんでした。

Gatsbyライブラリの中のPostCSSのバージョンが古いことが原因らしい

PostCSS側ではこの問題は解決されているみたいですが、Gatsbyが使っているPostCSS自体が古いため?エラーを解決できないようです。

nodeバージョン12系から15系に変更したついでに消えたエラー

[DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

ちなみに上のエラーも一緒に消えてくれました。 got@latest で解消できたという記事も見かけましたが何もせずに消えてくれました。

3
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
3
0