Cannot read property 'path' of undefined
jonesmwh opened this issue · comments
Nice looking theme, but I run into issues with a fresh install of gatsby - errors below:
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/hooks/useSiteConfiguration.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/hooks/useSiteConfiguration.tsx
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/hooks/useSiteMetadata.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/hooks/useSiteMetadata.tsx
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/sections/About/data.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/sections/About/data.tsx
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/sections/Articles/data.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/sections/Articles/data.tsx
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/sections/Contact/data.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/sections/Contact/data.tsx
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/sections/Hero/data.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/sections/Hero/data.tsx
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/sections/Interests/data.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/sections/Interests/data.tsx
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/sections/Legal/data.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/sections/Legal/data.tsx
ERROR #98123 WEBPACK
Generating development SSR bundle failed
/home/matthewjones/Pers/portfolio-minimal/node_modules/gatsby-theme-portfolio-minimal/src/sections/Projects/data.tsx: Cannot read property 'path' of undefined
File: node_modules/gatsby-theme-portfolio-minimal/src/sections/Projects/data.tsx
not finished Building development bundle - 2.454s
Output of gatsby info
System:
OS: Linux 5.11 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (16) x64 Intel(R) Core(TM) i7-10870H CPU @ 2.20GHz
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
Yarn: 1.22.15 - /usr/bin/yarn
npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm
Languages:
Python: 3.9.6 - /home/matthewjones/.pyenv/shims/python
Browsers:
Chrome: 95.0.4638.54
Firefox: 93.0
npmPackages:
gatsby: ^3.7.1 => 3.14.5
gatsby-theme-portfolio-minimal: latest => 2.6.3
Any help would be appreciated :)
Hey @jonesmwh, thanks for mentioning that! What did you do exactly? Started a new project and installed a fresh version of Gatsby + the theme?
To rule out any dependency version issues I just tried removing nvm, node, npm and yarn and starting again from scratch... but I still get the same error above.
I followed the environment set up steps here: https://www.gatsbyjs.com/docs/tutorial/part-0/
Then I ran:
gatsby new portfolio-minimal https://github.com/konstantinmuenster/gatsby-starter-portfolio-minimal-theme
cd portfolio-minimal
gatsby develop
As a comparison, the hello world template runs without issues https://www.gatsbyjs.com/starters/gatsbyjs/gatsby-starter-hello-world which suggests that my installation is working fine.
Edit - interestingly, your deprecated project https://github.com/konstantinmuenster/gatsby-starter-portfolio-minimal also runs without any issues
Hm, this is strange. I've tried it myself in a fresh environment and I had no problems with the following configuration:
System:
OS: macOS 11.5.2
CPU: (8) x64 Apple M1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.15 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 95.0.4638.69
Firefox: 92.0
Safari: 14.1.2
npmPackages:
gatsby: ^3.7.1 => 3.14.5
gatsby-theme-portfolio-minimal: latest => 2.6.4
npmGlobalPackages:
gatsby-cli: 3.13.0
Perhaps it is due to some Ubuntu/Mac differences I am not aware of.
It probably doesn't make a difference if you delete node_modules
, package-lock.json
, .cache
and run npm install
again, right?
Maybe you can also try to add just the theme package to an existing React project by running npm install gatsby-theme-portfolio-minimal
?
Also, I just released a v3.0.0
version of the theme that runs on Gatsby v4. Maybe that does the trick too? 😄
Your v3.0.0
change did the trick! I guess there must have been some issue as a consequence of the newer gatsby version! Thanks for looking into it :)
Greetings @konstantinmuenster
I am running into the same issue as @jonesmwh from above when deploying on Netlify.
How exactly do I update to the release v3.0.0 mentioned above?
Is it the same as installing the newest npm for the site or something different?
My Repo:
https://github.com/Charles-CarM/My_Website
Excuse my newbie level
Hey @Charles-CarM! No worries, usually you would set the version on this line: https://github.com/Charles-CarM/My_Website/blob/master/package.json#L16
But your site seems to be up to date, having the latest Gatsby and theme version installed. Do you have the exact same error output as in the first post?
Hey @Charles-CarM! No worries, usually you would set the version on this line: https://github.com/Charles-CarM/My_Website/blob/master/package.json#L16
But your site seems to be up to date, having the latest Gatsby and theme version installed. Do you have the exact same error output as in the first post?
I really like the look and feel of the portfolio website
It appears to be a different error:
TypeError: Cannot read properties of undefined (reading 'path') in regards to the createPages
section
In your gatsby-config
file, can you check if you have this property set? And if not, does it work if you set the blog settings object as in the referenced example?
@konstantinmuenster changing the blogSettings in the gatsby-config
did the trick and my site is now deployed.
Thanks so much for the help and guidance