我得到了这些构建错误,我不知道从哪里开始!
我不使用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这是dev中的错误:
<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.发布于 2022-03-31 04:17:22
把这些放进package.json
"resolutions": {
"gatsby-plugin-typescript": "^4.10.0",
"typescript": "^4.0.0"
},同样的问题和警告。我使用的是来自https://www.gatsbyjs.com/plugins/gatsby-theme-auth0-ts的gatsby主题-auth0-ts,而package.json中的配置消除了这几十条警告消息。
https://stackoverflow.com/questions/70725027
复制相似问题