Gatsby 4 升级 - 打字稿错误?不使用打字稿

cYb*_*t91 5 gatsby

我遇到这些构建错误,但我不知道从哪里开始!

我没有使用gatsby-plugin-typescript

谢谢!

11:52:19 AM: <w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Resolving 'gatsby-plugin-typescript/gatsby-node' in /opt/build/repo/node_modules/gatsby/dist/bootstrap for build dependencies doesn't lead to expected result '/opt/build/repo/node_modules/gatsby-plugin-typescript/gatsby-node.js', but to '/opt/build/repo/node_modules/gatsby/node_modules/gatsby-plugin-typescript/gatsby-node.js' instead. Resolving dependencies are ignored for this path.
<w>  at unknown 4 gatsby-plugin-typescript/gatsby-node
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-themes/index.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-themes/index.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-config-and-plugins.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-config-and-plugins.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/utils/worker/child/load-config-and-plugins.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/utils/worker/child/load-config-and-plugins.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/utils/worker/child/index.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/utils/worker/child/index.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby-worker/dist/index.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby-worker/dist/index.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/utils/report-once.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/utils/report-once.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/utils/page-mode.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/utils/page-mode.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/redux/actions/public.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/redux/actions/public.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/redux/actions/index.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/redux/actions/index.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/utils/api-runner-node.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/utils/api-runner-node.js
11:52:19 AM: <w>  at file dependencies /opt/build/repo/node_modules/gatsby/dist/utils/webpack.config.js
11:52:19 AM: <w>  at file /opt/build/repo/node_modules/gatsby/dist/utils/webpack.config.js
11:52:19 AM: <w>  at resolve commonjs /opt/build/repo/node_modules/gatsby/dist/utils/webpack.config.js

Run Code Online (Sandbox Code Playgroud)

这是开发中的错误:

<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Resolving 'gatsby-plugin-typescript/gatsby-node' in /Users/me/GitHub/project/node_modules/gatsby/dist/bootstrap for build dependencies doesn't lead to expected result '/Users/me/GitHub/project/node_modules/gatsby-plugin-typescript/gatsby-node.js', but to '/Users/me/GitHub/project/node_modules/gatsby/node_modules/gatsby-plugin-typescript/gatsby-node.js' instead. Resolving dependencies are ignored for this path.
Run Code Online (Sandbox Code Playgroud)

Cro*_*oss 1

将这些放入package.json中

  "resolutions": {
    "gatsby-plugin-typescript": "^4.10.0",
    "typescript": "^4.0.0"
  },
Run Code Online (Sandbox Code Playgroud)

这里有同样的问题和警告。我正在使用https://www.gatsbyjs.com/plugins/gatsby-theme-auth0-ts中的 gatsby-theme-auth0-ts ,而 package.json 中的配置消除了这几十条警告消息。