构建 gatsby 站点时如何解决错误 #95313?
How to resolve error #95313 when building a gatsby site?
我已经完成了我的 gatsby 项目,但是我在尝试构建时遇到了问题。我得到了这个 #95313 错误。我在项目中没有任何错误。
ERROR
Page data from page-data.json for the failed page "/success/": {
"componentChunkName": "component---src-pages-success-index-tsx",
"path": "/success/",
"result": {
"pageContext": {}
},
"staticQueryHashes": []
}
failed Building static HTML for pages - 1.268s
ERROR #95313
Building static HTML failed for path "/success/"
See our docs page for more info on this error: https://gatsby.dev/debug-html
WebpackError: TypeError: Cannot read property 'store' of null
- useSelector.js:126
[my-gatsby-site]/[react-redux]/es/hooks/useSelector.js:126:1
- index.tsx:13
webpack:/my-gatsby-site/src/pages/success/index.tsx:13:42
- static-entry.js:286
webpack:/my-gatsby-site/.cache/static-entry.js:286:22
- stylis.esm.js:74
[my-gatsby-site]/[@emotion]/stylis/dist/stylis.esm.js:74:1
我该如何解决?感谢您的帮助。
我想问题是您在 gatsby-browser.js
中使用了 wrapRootElement
包装器,而您还需要在 gatsby-ssr.js
中使用它,因为它是共享的 API .
Note: There is an equivalent hook in Gatsby’s SSR API. It is
recommended to use both APIs together. For example usage, check out
Using redux.
我已经发布了一个应该修复它的 PR:https://github.com/Dovtutis/playEverywhere/compare/main...fbuireu:patch-1
我已经完成了我的 gatsby 项目,但是我在尝试构建时遇到了问题。我得到了这个 #95313 错误。我在项目中没有任何错误。
ERROR
Page data from page-data.json for the failed page "/success/": {
"componentChunkName": "component---src-pages-success-index-tsx",
"path": "/success/",
"result": {
"pageContext": {}
},
"staticQueryHashes": []
}
failed Building static HTML for pages - 1.268s
ERROR #95313
Building static HTML failed for path "/success/"
See our docs page for more info on this error: https://gatsby.dev/debug-html
WebpackError: TypeError: Cannot read property 'store' of null
- useSelector.js:126
[my-gatsby-site]/[react-redux]/es/hooks/useSelector.js:126:1
- index.tsx:13
webpack:/my-gatsby-site/src/pages/success/index.tsx:13:42
- static-entry.js:286
webpack:/my-gatsby-site/.cache/static-entry.js:286:22
- stylis.esm.js:74
[my-gatsby-site]/[@emotion]/stylis/dist/stylis.esm.js:74:1
我该如何解决?感谢您的帮助。
我想问题是您在 gatsby-browser.js
中使用了 wrapRootElement
包装器,而您还需要在 gatsby-ssr.js
中使用它,因为它是共享的 API .
Note: There is an equivalent hook in Gatsby’s SSR API. It is recommended to use both APIs together. For example usage, check out Using redux.
我已经发布了一个应该修复它的 PR:https://github.com/Dovtutis/playEverywhere/compare/main...fbuireu:patch-1