已将whatwg-fetch添加到我的Gatsby项目yarn add whatwg-fetch
中,但不再构建。
相反,我收到以下错误:
错误#95313
构建静态HTML失败
WebpackError:ReferenceError:未定义自身
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>