admin管理员组文章数量:1291298
I am trying to migrate my existing ReactJS app with WordPress backend to GatsbyJS. I am new to GatsbyJS and followed the instructions on their page for the setup on a Windows 10 machine. The setup ran pretty well and I could start my migration process, but after some time I only got the following error when trying to load the page:
TypeError: Cannot read property 'ponent---src-pages-index-jsx' of undefined
fetchResource
D:/GitHub/gatsby-starter-wordpress/.cache/loader.js:77
74 | // Find resource
75 | let resourceFunction
76 | if (resourceName.slice(0, 12) === `ponent---`) {
> 77 | resourceFunction = asyncRequiresponents[resourceName]
78 | } else if (resourceName.slice(0, 9) === `layout---`) {
79 | resourceFunction = asyncRequires.layouts[resourceName]
80 | } else {
View piled
getResourceModule
D:/GitHub/gatsby-starter-wordpress/.cache/loader.js:112
109 | cb(failedResources[resourceName])
110 | })
111 | } else {
> 112 | fetchResource(resourceName, (err, executeChunk) => {
113 | if (err) {
114 | cb(err)
115 | } else {
View piled
getResourcesForPathname
D:/GitHub/gatsby-starter-wordpress/.cache/loader.js:358
355 | })
356 | }
357 | }
> 358 | getResourceModule(pageponentChunkName, (err, c) => {
359 | if (err) {
360 | handleResourceLoadError(
361 | page.path,
View piled
new ComponentRenderer
D:/GitHub/gatsby-starter-wordpress/.cache/ponent-renderer.js:26
23 |
24 | this.state = {
25 | location,
> 26 | pageResources: loader.getResourcesForPathname(location.pathname),
27 | }
28 | }
29 |
View piled
▶ 43 stack frames were collapsed.
(anonymous function)
D:/GitHub/gatsby-starter-wordpress/.cache/app.js:42
39 | Root = Root.default
40 | }
41 |
> 42 | domReady(() =>
43 | ReactDOM.render(
44 | <HotContainer>
45 | <Root />
View piled
HTMLDocument.listener
D:/GitHub/gatsby-starter-wordpress/node_modules/domready/ready.js:23
I tried removing any of my custom written ponents until I ended up with the normal starting boilerplate. But it still wouldn't work. So I went on and even created a new project to test if gatsby-cli
is still functional. But uninstalling and reinstalling the package did still not fix my problem. Any help or tip would be appreciated.
I am trying to migrate my existing ReactJS app with WordPress backend to GatsbyJS. I am new to GatsbyJS and followed the instructions on their page for the setup on a Windows 10 machine. The setup ran pretty well and I could start my migration process, but after some time I only got the following error when trying to load the page:
TypeError: Cannot read property 'ponent---src-pages-index-jsx' of undefined
fetchResource
D:/GitHub/gatsby-starter-wordpress/.cache/loader.js:77
74 | // Find resource
75 | let resourceFunction
76 | if (resourceName.slice(0, 12) === `ponent---`) {
> 77 | resourceFunction = asyncRequires.ponents[resourceName]
78 | } else if (resourceName.slice(0, 9) === `layout---`) {
79 | resourceFunction = asyncRequires.layouts[resourceName]
80 | } else {
View piled
getResourceModule
D:/GitHub/gatsby-starter-wordpress/.cache/loader.js:112
109 | cb(failedResources[resourceName])
110 | })
111 | } else {
> 112 | fetchResource(resourceName, (err, executeChunk) => {
113 | if (err) {
114 | cb(err)
115 | } else {
View piled
getResourcesForPathname
D:/GitHub/gatsby-starter-wordpress/.cache/loader.js:358
355 | })
356 | }
357 | }
> 358 | getResourceModule(page.ponentChunkName, (err, c) => {
359 | if (err) {
360 | handleResourceLoadError(
361 | page.path,
View piled
new ComponentRenderer
D:/GitHub/gatsby-starter-wordpress/.cache/ponent-renderer.js:26
23 |
24 | this.state = {
25 | location,
> 26 | pageResources: loader.getResourcesForPathname(location.pathname),
27 | }
28 | }
29 |
View piled
▶ 43 stack frames were collapsed.
(anonymous function)
D:/GitHub/gatsby-starter-wordpress/.cache/app.js:42
39 | Root = Root.default
40 | }
41 |
> 42 | domReady(() =>
43 | ReactDOM.render(
44 | <HotContainer>
45 | <Root />
View piled
HTMLDocument.listener
D:/GitHub/gatsby-starter-wordpress/node_modules/domready/ready.js:23
I tried removing any of my custom written ponents until I ended up with the normal starting boilerplate. But it still wouldn't work. So I went on and even created a new project to test if gatsby-cli
is still functional. But uninstalling and reinstalling the package did still not fix my problem. Any help or tip would be appreciated.
-
1
Hmm, this looks like it might be resolved by removing your
.cache
folder (rm -rf .cache
on *nix…not sure what the Windows equivalent is) and re-runninggatsby develop
. – coreyward Commented Sep 1, 2018 at 3:14 - @coreyward I am not sure if it was your solution but it seems to work now. I additionally installed a Linux subsystem for Windows in the belief that it could somehow work. and no it does so thank you i guess. – Gabsii Commented Sep 3, 2018 at 9:57
2 Answers
Reset to default 10I had the same problem. I've fixed it by cleaning the browser cache.
I've done gatsby clean
before cleaning the chrome's cache but I think is not related.
had this issue with gatsby-plugin-offline
plugin, cleaning the cache didn't help so I disabled the plugin for the development
(local) environment, it works well on production
本文标签: javascriptGatsbyCannot read property 39componentsrcpagesindexjsx39 of undefinedStack Overflow
版权声明:本文标题:javascript - Gatsby - Cannot read property 'component---src-pages-index-jsx' of undefined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741529682a2383679.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论