Next.js 9.3 was released 9th of March and has a new and exciting feature for all headless CMS users out there: Static Site Generation coupled with ...
For further actions, you may consider blocking this person and/or reporting abuse
I'm getting
context.previewasundefined. Possible reason: github.com/zeit/next.js/discussion...?Do you have Craft 3.4 installed?
And can you do a console.log inside the
pages/api/preview.tsfile, so that we can be sure, that the function gets called correctly?And what do you get if you log the
contextvariable inside the getStaticProps function?Yup! Running Craft 3.4.11. I've also upgraded Next to 9.3.4@canary mentioned in this Github issue: github.com/zeit/next.js/issues/112...
But when I access the preview page directly (from Craft's iFrame), it sends the correct context:
Thanks for the quick responses, Matthias!
Does it help to update to the newest Craft 3.4.16? (github.com/craftcms/cms/blob/maste...)
It adds CORS headers with a
*so maybe that helps in your case.@mark
Now I also had the problem that the Next.js frontend didn't update in the live preview. Then I deleted the cookies for the domain where Craft runs and suddenly it worked again... Very strange and at the moment I have no idea what went wrong with the cookies.