Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): don't force prerender / if user doesn't have that route #8639

Merged
merged 2 commits into from Nov 3, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

nuxt/nuxt#14168

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 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)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

With pages module, we add routes to the default routes values. But if the user doesn't have a ~/pages/index.vue file we can safely skip processing the default / route for prerender.routes.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added the bug Something isn't working label Nov 2, 2022
@danielroe danielroe requested a review from pi0 November 2, 2022 18:53
@danielroe danielroe self-assigned this Nov 2, 2022
@codesandbox
Copy link

codesandbox bot commented Nov 2, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Nov 2, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit ae971f0
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6362bcf97166060008c5585f

@Atinux
Copy link
Member

Atinux commented Nov 2, 2022

What about if the user has an app.vue but no pages? I think we should keep rendering the home page in that case

Copy link
Member Author

Yes, agreed. This change only affects the pages ad-hoc module. (So it only prevents force-rendering a 404.)

@pi0
Copy link
Member

pi0 commented Nov 3, 2022

Would it still generate index.html for spa mode? (it is main fallback file) (checked, it does with /index.html route)

@pi0 pi0 merged commit 71ecffa into main Nov 3, 2022
@pi0 pi0 deleted the fix/generate-index branch November 3, 2022 14:52
@pi0 pi0 mentioned this pull request Nov 3, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants