Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

zunderbolt
Copy link
Contributor

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I have a static site with several normal pages + a few thousand dynamic ones which are prerendered by inserting their routes in nitro prerender:routes hook like that:

"prerender:routes"(routes) {
    const pages = getPages();
    if (pages.length) {
      for (const route of pages) {
        routes.add(route);
      }
    }
  },

After updating to Nuxt 3.11.0, I noticed an unexpected change in the generated build where all static pages, except for index.html, were missing, though all dynamic pages were still present. Upon investigation, it appeared that the routes parameter, which previously contained all static routes (Set(63) { '/about', '/uk/about', ...}) in Nuxt 3.10, was reduced to only Set(1) { '/' } in Nuxt 3.11.0.

This issue seems to stem from the changes made in ff1bb56, and this PR addresses the problem.

P.S. This is my first contribution to this project. I was unsure whether a separate issue should be created for this trivial fix. Apologies if this was an oversight.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

Fixed not sending gathered pages routes to nitro2.options.prerender.routes
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you ❀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants