Hello @beamer,
That error happens because null
is an invalid input for the options parameter. That line could be changed to this:
const refOption = previewRef ? { ref: previewRef } : undefined
or
const refOption = previewRef ? { ref: previewRef } : {}
But we would actually recommend using the queryContentFromRef()
method instead.
You can see an example of a createClient()
function and how it’s used. I am sharing zip files with you.
pages.zip (4.8 KB)
prismicConfiguration.js.zip (641 Bytes)
Used getStaticProps
in a pages.
The createClient
function in a prismicConfiguration.js
file.
Used resolvePreviewURL
in a "preview.js' file.
Let me know if you have any further questions related to it.
Thanks,
Priyanka