question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

generateStaticRoutes still results in API request

See original GitHub issue

I am using the generateStaticRoutes option with my deployment. After the build, I can see the static files were generated correctly in the output, however navigating to a pre-generated page on the client side still results in a hit to /api on my CMS.

Maybe I’m misunderstanding what this feature does, but I would expect to get a payload.js when requesting pages that have already been generated. Am I missing something or is this an error?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jonathanmelvillecommented, Aug 6, 2021

@danielroe Awesome news, that would truly be the best of both worlds. Thanks again.

0reactions
danielroecommented, Aug 20, 2021

@jonathanmelville Yes, the question is just when the generation happens. If you generate them at build time then the first user to access the pages gets them instantly. Otherwise the first user to access the page encounters a delay and subsequent users get them instantly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt generate is keeping my dynamic routes working
The docs say that dynamic routes do not work with this, but my app (/dist) still works on static server after generating, even...
Read more >
generateStaticRoutes doesn't work for main index.vue ...
Hey, the feature "generateStaticRoutes": true does work pretty well ... for main index.vue – landingpage re-rendered on each request #669.
Read more >
next-server.ts - vercel/next.js - Sourcegraph
render-result.ts ... send module will throw 412 with conditional GET request ... Resolves `API` request, in development builds on demand.
Read more >
Vercel Builder for Nuxt.js - Morioh
This builder will run a given custom build step if you have added a vercel-build key under scripts in package.json . Deploying additional...
Read more >
Confused about nextjs data fetching - Reddit
I've looked at the documentation a bit and am still pretty confused. I have a React app that fetches data from an API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found