New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'length' of undefined #155
Comments
hey @joelgrodriguez i was able to reproduce, thats relaly strange What results do you get when you run this query inside of the GraphiQL IDE?
the issue is for some reason the query isn't finding the post by it's slug |
This was returned:
|
@doingandlearning have you seen something like this before? any ideas? the post metadata coming from the homepage has the
|
I'm thinking it may have something to do with Kinsta? I just tested this on local install using Local by Flywheel and I am able to load the post with no errors. |
This is interesting. I think there was some talk about deprecating the To fix this in our code, we'd move from using
I'll send a message on the WPGraphQL Slack group about it to confirm if a new change has been made. I note that when I use this new query on your instance @joelgrodriguez I get the data back as expected. |
I was able to get the expected data back but with a modified query from yours @doingandlearning :
The query provided above returned an error for me. Thanks |
thanks for the heads up both of you, will get that updated to the new query format unless one of you wanna put in a PR :) |
Fixed via #156 |
I just installed a fresh instance of WP and the starter.
The home page pulls up no problem but...
For some reason when I click on a post I am getting this error.
Server Error
TypeError: Cannot read property 'length' of undefined
`
147 |
148 | const { categories, postId } = post;
I have not added anything else to the starter (other than the graphql endpoint).
I have not added any posts new posts.
I added only one additional category for testing.
Is there a step I am missing?
Here is the WP install: http://newtechmachinery.kinsta.cloud/
thanks
The text was updated successfully, but these errors were encountered: