-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP fetch even when project is generated #22948
Comments
related to #22841 and could be related to @nuxt/content module. |
when payload is not fetched, https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/plugins/payload.client.ts#L6, return before calling link:prefetch. |
export function isPrerendered() {
const nuxtApp = useNuxtApp();
return !!nuxtApp.payload.prerenderedAt;
} And here the payload [{"state":1,"_errors":128,"serverRendered":130,"path":7,"prerenderedAt":-1}] Do you have it? Yes, prerender is set to -1 so payload is never fetched. |
Here the issue 🤨 https://github.com/nuxt/content/blob/main/src/runtime/legacy/plugins/documentDriven.ts#L298#22947 But why? (for studio?) Using document-driven mode, payload is never fetched. And this could explained why there is http call (fetch parsed md files). |
related to nuxt/content#1526 |
Environment
Reproduction
https://github.com/Barbapapazes/fetch-made-even-with-generated
npm run generate
localhost:3000
/about
and take a look at the network tab in the inspector. You will see that a request is made toungh.cc
despite that the project is generated and the content inside the payload.Describe the bug
useFetch
query data despite that the project is generated and content inside the payload.When we navigate from
/
to/about
, an http call is made but when going directly to/about
payload is load so no nitro call is made. Will try without nuxt/content.Without the content module, https://github.com/barbapapazes/fetch-made-even-with-generated-without-content, the payload is fetched when navigating between home and about.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: