Preview link from the experience editor keeps showing default content on our Next.js site
Expected: our developer shared a preview link from the experience editor, I open it and see the variant we drafted, with the preview widget somewhere on the page.
Actual: the page loads with the default content and there is no widget at all, on Chrome and Firefox both. The developer opens the same link and sees the same thing, so it is not just my machine.
The experience is still a draft, which I assumed is the whole point of previewing. The link was generated yesterday afternoon. What are the actual requirements for preview to work on a Next.js site? happy to relay anything technical back to the dev
2 answers
The 24-hour expiry that tomdev83 mentioned is the most common cause, so start with a freshly regenerated link. If that still shows default content and no widget, there are three requirements to check with your developer, and any one of them failing produces exactly what you described:
- The slot must be integrated in the page you are previewing. If the code never requests that slot, there is nothing for the preview to override.
- The slot version in code must match the version being previewed. If the code pins home-hero@1 and the draft targets version 2, the preview will not apply.
- The domain you open the link on must be listed in your application's trusted origins. A missing domain fails silently to defaults.
When everything is in place you will see the widget in the bottom-right corner showing the experience, experiment, audience, variant, and locale being previewed, which is also a handy way to confirm you are looking at the right draft. In my experience with Next.js sites specifically, the version mismatch is the one to bet on when the link is fresh and the widget is absent. The full list of requirements is in the preview documentation.
It was the version mismatch, the code pinned an older slot version. Fresh link plus the version bump and the widget showed up right away. Thanks both!
First thing to check given your timeline: preview links are only valid for 24 hours. "Generated yesterday afternoon" could easily mean it silently expired by the time you tested this morning, and an expired link falls back to default content. Have the developer regenerate the link from the editor and try again within a few minutes. If a fresh link still shows defaults, then it is one of the setup requirements rather than expiry.