BuilderIO / BuilderIO/builder

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

Open
#4,124 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.8k
Forks
1.2k
Avg merge
1d 6h
Merged PRs (30d)
17

Description

The Nuxt 3 and Nuxt 3 catch all solutions ([here](https://github.com/BuilderIO/builder/blob/main/examples/vue/nuxt-3-catchall/pages/%5B...app%5D.vue#L5) and [here](https://github.com/BuilderIO/builder/blob/main/examples/vue/nuxt-3/app.vue#L5)) 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.