I am trying to query a document using the $prismic object $prismic.client.getByUID(uid, type), however I keep getting an error. I assume I must be missing an import somewhere?
I have installed the @prismicio/vue dependency (which seems to also include prismic-javascript & prismic-dom)
Am I missing something?
Cheers,
Patrick
P.S. In your documentation you have it listed as $prismic.client.getByUID(uid, type) however in your example, it seems to follow type and THEN uid const document = await $prismic.client.getByUID('page', params.uid)
Thanks for sharing the vue dependency document, we need to update this. Have you installed the @nuxtjs/prismic dependency too?
Can you please try to change your query to $prismic.api.getByUID(type, uid).
thanks for your response. It works now after using "$prismic.api.getByUID…" instead of "$prismic.client.getByUID".
Assuming this is the same for other users, this would of course be beneficial to update on your documentation (Query Content from the CMS with Nuxt.js - Prismic). In total, two issues seem to be present (please verify):
"api" needs to be used instead "client"
The documentation is showing the argument for the getByUID method in the wrong order.