-
-
Notifications
You must be signed in to change notification settings - Fork 348
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 properties of null (reading 'url') #22
Comments
You probably forgot to fetch the photo in the graphQL query |
Me too. I already fetched the photo correctly. But, still get the same error |
Owhhh. I found the solution. You probably haven't published your author profile photo at graphCMS. The photo is still a draft. That's why the error occurs |
i already have my photo published but it still doesn't work... |
Check all of your assets again in GraphCMS |
I'm facing the same problem. If your found a fix could you post it? please |
Go to assets section and select the images and Publish Them |
I m getting the same issue .any one can help? |
the issue is from the cms. although you have published the article you have to make sure to publish the image too. The image is probably an a pending mood waiting to be published |
Instead of getting the photo url like a property, try to call the url method on it like so src={urlForSanityImage(post.mainImage).width(200).url()}
export const urlForSanityImage = (source: any) => {
return builder.image(source);
}; |
The text was updated successfully, but these errors were encountered: