-
Notifications
You must be signed in to change notification settings - Fork 55
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
Asset is sometimes empty in production build #57
Comments
Believe I just experienced the same. Asset kept returning as null in my Sanity data |
The issue appears to be that when the video asset ID is set, it does not set "_type" to "reference". I modified the package locally in components/input.js where _ref is set to also set _type: 'reference' and manually readded all the videos. Experiencing the same with Sanity and Gatsby. The video asset loads in the GraphQL explorer for Sanity: But not the GraphQL explorer for Gatsby: |
I'm having the same issue. Seems like a quick fix to get done properly. Is it likely to happen soon? |
Hey y'all, can you test |
I'm still seeing this issue in Gatsby. It will work for some time, then for some reason come back as null. If you do |
Me too! It does set _type to _reference, but that doesn't fix the issue. I gave up in the end and had to write a hugely convoluted custom publish script to pull all the data I need into fields, so it can't just disappear. Not ideal. |
Related to this sanity-io/gatsby-source-sanity#154, perhaps? |
@palmerama Would you be able to share your solution? I'm moving into production with a site soonish and this issue is a blocker at the moment. |
@intelligence last resort you could write a build script to use the sanity json api instead of the graphql endpoint to pull the mux data during build time then inject it into your gatsby site using an env variable or a gatsby source plugin to read it from a file |
I think I may have found the underlying issue for why it turns up empty. Adding: After: |
This is now fixed with the upcoming See: #43 (comment) |
For some reason the mux asset in Gatsby is sometimes an empty object in production build with no playbackid. We fixed it by temporarily hard coding the playbackID in the front end.
Is this an issue with the mux sanity input or sanity's api or gatsby somehow?
The text was updated successfully, but these errors were encountered: