Skip to content

Nuxt 3 examples preview environment broken for initial SSR loads [Fix attached] #4124

@klngrs

Description

@klngrs

The Nuxt 3 and Nuxt 3 catch all solutions (here and here) do not work out of the box for SSR because preview query parameters are not passed to isPreviewing().

To reproduce:

  1. Implement one of the Nuxt 3 examples above in an SSR Nuxt 3 app.
  2. Attempt to access a page through the builder.io preview environment

Result: It'll say "Content not found" or you'll get the error pop-up that something is not configured correctly.

Fun note: If you update your app locally, HMR triggers a client update which then DOES trigger a working client call with fetchOneEntry - enabling the preview environment to work. The initial impression is a flaky builder preview environment that sometimes works and sometimes does not (no good!).

To fix:
const route = useRoute();
Pass query params to isPreviewing as follows... isPreviewing(route.query)

PR incoming

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions