You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please try running the npm run generate command in this reproduction example.
Describe the bug
The generate command was working fine in rc-12 when async routes were provided to the generate command.
In rc-13 it no longer generates the specified routes (you can see only 200 and 400 routes are generated instead of the provided routes).
On another note: Is it possible to disable the crawler altogether and make nuxt generate just the pages that I provide in the generate.routes option? It doesn't seem to be such an option now.
Also, typescript reports an error for when I specify an async function for routes.
Additional context
No response
Logs
❯ npm run generate
$ nuxt generate
Nuxi 3.0.0-rc.13
Nuxt 3.0.0-rc.13 with Nitro 0.6.1
ℹ Client built in 1064ms
ℹ Building server...
✔ Server built in 339ms
✔ Generated public .output/public
ℹ Initializing prerenderer
ℹ Prerendering 3 initial routes with crawler
├─ async routes() {
return await Promise.resolve(['/', '/pricing']);
} (undefinedms) (TypeError [ERR_INVALID_URL]: Invalid URL)
├─ /200.html (36ms)
├─ /404.html (1ms)
✔ You can now deploy .output/public to any static hosting!
The text was updated successfully, but these errors were encountered:
Nuxt 3 does not do anything with a function provided in generate.routes.
What did change in rc12 is that we stopped generating / by default. But this is fixed in the edge channel via nuxt/framework#8782.
If you want to disable crawler, set nitro.prerender.crawlLinks to false. If you want to add routes manually, add to nitro.prerender.routes. If you need an async function, see #13949.
Thanks a lot for the answer! Got it now and it works with the solution you provided. I was misguided by this config option existing in the v3 docs.
I also figured it would be possible to specify the routes statically, without async when using defineNuxtConfig(async () => {}), but it seems to be deprecated. What will be the go-to solution for setting async runtimeConfig parameters in this case?
Environment
Nuxi 3.0.0-rc.13
RootDir: /home/projects/github-uyhfhu
Nuxt project info:
Linux
v16.14.2
3.0.0-rc.13
0.6.1
[email protected]
vite
generate
-
-
Reproduction
https://stackblitz.com/edit/github-uyhfhu?file=nuxt.config.ts
Please try running the
npm run generate
command in this reproduction example.Describe the bug
The generate command was working fine in rc-12 when async routes were provided to the generate command.
In rc-13 it no longer generates the specified routes (you can see only 200 and 400 routes are generated instead of the provided routes).
On another note: Is it possible to disable the crawler altogether and make nuxt generate just the pages that I provide in the generate.routes option? It doesn't seem to be such an option now.
Also, typescript reports an error for when I specify an async function for routes.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: