Closed kieranstartup closed 1 year ago
Same issue here, links just aren't appearing in preview.
is there any update/ fix for this issue @angeloashmore?
@jodiedoubleday I don't think we'll be getting much support on the plugin going forward based on this blogpost. And it looks like Netlify laid off most of the Gatsby team too 😬
@jodiedoubleday @kieranstartup - would you recommend upgrading to v6?
My client and I have been waiting for v6 for half a year, but I'm a bit anxious upgrading it due to bugs like this and the lack of support from Prismic/Gatsby teams.
@kb1995 I think in all honesty it's still better to upgrade. There are a few small bugs that need fixing but nothing serious, it's soo much faster to preview large repos.
@kb1995 Yeah I second that, it's definitely still better to upgrade. As a heads up, the docs are all here now rather than on the Prismic site.
Hey everyone, Proxy
s are necessary to support the content relationship document
property during previews. You will see a Proxy
object when console.log()
ing a field, but the data is still in it.
You can confirm this by logging properties of the object rather than the whole object. For example:
console.log(myField.url)
Alternatively, you can inspect Proxy
s by opening the [[Target]]
value in Chrome's DevTools:
@kieranstartup There was a bug in how links were processed during previews that made the url
property always return null
. That may have been what you were experiencing.
Could you upgrade to v6.0.1
and let me know if your problem was resolved? Thanks!
Hey @angeloashmore,
Thanks for implementing this, I've just tested and it works perfectly.
Really appreciate it!
Hey,
So this may be related to issue #422, but whenever I'm previewing a document and trying to access a link field, the field returns Proxy(Object), rather than the url. This is probably fine in a lot of cases, but in my case I'm trying to access a Vimeo mp4 file link, and then preview that within a
<video>
, so it's causing some issues where my client can't preview their changes.Versions
gatsby-source-prismic
: 6.0.0gatsby-plugin-prismic-previews
: 6.0.0gatsby
: 5.11.0Node.js
: v18.14.0Steps to reproduce
Add a link field to a slice. Add a link (in my case a link to a Vimeo mp4 video file).
What is expected?
Link field outputs the url, and displays the video.
What is actually happening?
Link field outputs Proxy(Object) instead of a url. I've tried following some of the suggestions in issue 422 with optional chaining but it's not getting me anywhere.
Screenshots
Let me know if you have any thoughts or need anything else to help replicate.
Thanks!