【发布时间】:2020-03-10 17:22:35
【问题描述】:
将 whatwg-fetch 添加到我的 Gatsby 项目 yarn add whatwg-fetch,但它不再构建。
相反,我收到以下错误:
错误 #95313
构建静态 HTML 失败
WebpackError: ReferenceError: self is not defined
fetch.umd.js:8 node_modules/whatwg-fetch/dist/fetch.umd.js:8:1
fetch.umd.js:2 node_modules/whatwg-fetch/dist/fetch.umd.js:2:63
fetch.umd.js:5 对象../node_modules/whatwg-fetch/dist/fetch.umd.js node_modules/whatwg-fetch/dist/fetch.umd.js:5:2
provider.js:1 模块../src/store/provider.js src/store/provider.js:1:1
gatsby-ssr.js:1 模块../gatsby-ssr.js gatsby-ssr.js:1:1>
【问题讨论】:
标签: reactjs window fetch gatsby