gatsby: Gatsby develop command error
Hi everyone,
I just created a new Gatsby project for a client.
I just ran these following commands
gatsby new mynewproject
cd mynewproject
gatsby develop
Until here, nothing wrong. But when i’m on localhost:8000 I have this error message :
TypeError: Cannot read property ‘jsonName’ of undefined
I tried several time to delete the folder and reinstall Gatsby but I can’t fix this issue.
fireshot capture 3 - - http___localhost_8000_
What can I do in order to solve this issue ??
Thank in advance for your help.
Have a great day.
Maral
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 49 (24 by maintainers)
Ehmmm, yeah… I reported that one month ago didn‘t I?
@rdela It finally works, thanks a lot !!!
Thanks for describing your encounter with this error @anttti!
@MaralS does this hold true for your case? If so, would you try moving the project(s) directories to a path with only alphanumeric characters, underscores, and hyphens (
a-z,0-9,_, and-itself) and see if that solves for now?From your earlier error: https://github.com/gatsbyjs/gatsby/issues/3183#issuecomment-370128994
Looks like
Développementwould be the culprit. Could you add a new directory,dev, or something without an accent or any other diacritics underMaral_Sabbaghand movegatsby-boilerplatethere (or clone source again,gatsby new, whatever you were doing before, or whatever is easiest if you do not want to movegatsby-boilerplate), see if that works and report back when you can?If it does work, hoping this is a temporary fix and we can get Gatsby working on any path that should work on Windows soon.
Cc @szimek @LeKoArts @KyleAMathews
Ran into this issue today while hosting a workshop for local students. On Windows, if the project is under a path that has non-[a-zA-Z0-9] letters (in our case, the letter ‘ä’), this problem occurs.
@MaralS Yeah, it’s probably something similar to the layout issue, where the glob pattern was working on Mac and Linux, but not on Windows. I’ll try to find some time till the end of this week to set up Windows VM again and see if I can reproduce this error.
I first checked that one but my problem wasn’t resolved by that. But my folder had
ä,ö,üin the name… After removing these letters it worked.Maybe that helps! 😃
@KyleAMathews
I’ve just encountered the same error, but it was my mistake. When calling
createPageingatsby-node.jsI’m passing layout name based onlocaleparameter coming from a query, but I forgot to create layout files for all supported locale. So it was trying to find a layout with iddebut failed, because there was no such file insrc/layouts.So it looks like there are 2 similar issues:
node-globpackage, layouts files can’t be found and thus it fails to find any layoutThe first issue could be solved by throwing an error if a layout can’t be found in pages-writer.js#L45-L49 and then catching rejected promise in https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/bootstrap/index.js#L360
I can create a PR for that, but I’m not sure though if error reporting is done simply using
console.logor by some other mechanism.The second issue could be solved by adding some check after generating new Gatsby project to see if at least the default
indexlayout can be found.While it sucks a bit, if it’s really caused by this permissions issue, maybe Gatsby could check file permissions when creating a new app and report an error/warning if they are incorrect (whatever it actually means) and could break
node-glob?OS: Windows 10 64-bit Node: 8.9.4 Yarn: 1.3.2 Gatsby: 1.9.157
Followed the exact steps on the Gatsby website, installed the Gatsby CLI and then ran the commands as shown.