Preview not working in SSR
See original GitHub issueHi,
In nuxt ssr true this doesn’t work for my project
Here is my prismic code
prismic: {
endpoint: 'https://my-repo.cdn.prismic.io/api/v2',
linkResolver: '@/plugins/link-resolver',
htmlSerializer: '@/plugins/html-serializer',
preview: '/preview'
/* see configuration for more */
},
Error in console
Access to XMLHttpRequest at 'https://my-repo.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=1&ref=https%3A%2F%2Fmy-repo.prismic.io%2Fpreviews%2FYAGwfBEAACMAgZ45%3AYAGzWREAACAAgaup%3FwebsitePreviewId&lang=*&q=%5B%5Bat(document.id%2C%20%22X_2fHxEAACEAbu1Q%22)%5D%5D' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top Results From Across the Web
Preview not working in SSR · Issue #115 · nuxt-modules/prismic
Hi, In nuxt ssr true this doesn't work for my project Here is my prismic code prismic: { endpoint: 'https://my-repo.cdn.prismic.io/api/v2', ...
Read more >Does Live Preview with SSR still function? | Community
I do have Live Preview working using the example NextJS repo, but this is based on client-side rendering. Should SSR still work and...
Read more >React Server Side Rendering (SSR) meta tags og not ...
I need a solution for all the dynamic links to display preview info with ... Problem is that I need a subscription plan...
Read more >Sanity.io SSR previews without changing your front-end code
This works okay, but requires you to change your components and front-end code. Previews should be table-stakes for editorial experience, but ...
Read more >Advanced Features: Preview Mode | Next.js
js has a feature called Preview Mode which solves this problem. Here are instructions on how to use it. Step 1. Create and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, I was able to reproduce the issue with @phillysnow, finally!
After analyzing working and not-working lock files, turns out the issue was a really murky one due to @nuxt/ufo@0.5.0 that was introduced in nuxt@2.14.12 patch on the 16th of December.
Everyone that installed this patch before the 6th of January might encounter it.
After this date, the bug got fixed as of @nuxt/ufo@0.5.3 release.
If you’re encountering this bug, to fix the issue you need to run
$ npm update
or$ yarn upgrade
in order to update@nuxt/ufo
to version0.5.3
or higher, let us know if the bug persists.Cheers~!
Here’s a quick follow up of our discussion on Twitter:
After some time we noticed that that the value of
websitePreviewId
was getting stripped on Rahul’s website, leading to the issue:We tried to troubleshoot a ton of things to figure that out. Unfortunately, I wasn’t able to reproduce this issue on my end and Rahul was not able to attempt a reproduction. Being fine with not having preview for now we’re closing this issue.
Happy to reopen it if someone is experiencing the same issue or able to provide a reproduction!