vercel-builder icon indicating copy to clipboard operation
vercel-builder copied to clipboard

generateStaticRoutes doesn't work for main index.vue – landingpage re-rendered on each request

Open Fabioni opened this issue 3 years ago • 1 comments

Hey, the feature "generateStaticRoutes": true does work pretty well but unfortunately especially for the landingpage, so the main index.vue it does not work, so this page is always re-rendered on the server on each request. Any ideas about that? @danielroe

I assume it has something to do with the fact that the index.html is maybe also the route for the fallback ssr lambda function.

Fabioni avatar Apr 15 '22 22:04 Fabioni

When setting lambdaName: 'notindex' in nuxt.config it works but then the server fallback for not-generated pages does not work and I just get a 404 from vercel.

Assosited code: https://github.com/nuxt/vercel-builder/blob/90cf41da3afb0c438f89f997303612cd3fbfa041/src/build.ts#L160

So we need a way to differentiate between the index file and the index fallback.

I think what could work is using lambdaName instead of fixed index here:

https://github.com/nuxt/vercel-builder/blob/90cf41da3afb0c438f89f997303612cd3fbfa041/src/build.ts#L300

Fabioni avatar Apr 15 '22 22:04 Fabioni