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

refactor(nuxt)!: remove support for 404.vue shorthand#8809

Merged
pi0 merged 1 commit intomainfrom
fix/remove-404-feature
Nov 9, 2022
Merged

refactor(nuxt)!: remove support for 404.vue shorthand#8809
pi0 merged 1 commit intomainfrom
fix/remove-404-feature

Conversation

@danielroe
Copy link
Copy Markdown
Member

@danielroe danielroe commented Nov 8, 2022

🔗 Linked issue

resolves nuxt/nuxt#14702

❓ 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

This PR removes support for the 404.vue shorthand (mapping to a catchall with 404 status code). This was confusing when users also had a manual catchall, such as [...slug].vue (as the latter would never be hit). And it also separated out the 404 error page from error.vue which was used to render every other error page.

👉 Migration

  1. Rename your 404.vue page to [...slug].vue.
  2. Manually set the response status within that page.
  <script setup>
+   setResponseStatus(404)
  </script>

📝 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 8, 2022
@danielroe danielroe requested review from antfu and pi0 November 8, 2022 13:21
@danielroe danielroe self-assigned this Nov 8, 2022
@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Nov 8, 2022

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

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 8, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit 17ac03c
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/636a57d32fc9fa0009ccafec

@danielroe danielroe added 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing breaking-change labels Nov 8, 2022
@pi0 pi0 changed the title fix(nuxt)!: remove support for 404.vue shorthand refactor(nuxt)!: remove support for 404.vue shorthand Nov 9, 2022
@pi0 pi0 merged commit 10c2272 into main Nov 9, 2022
@pi0 pi0 deleted the fix/remove-404-feature branch November 9, 2022 09:05
BenjaminOddou added a commit to BenjaminOddou/portfolio that referenced this pull request Nov 9, 2022
@pi0 pi0 mentioned this pull request Nov 15, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@ibrahim-990
Copy link
Copy Markdown

hello,
why in production mode not work the 404 page
iam set [...slug].vue in folder pages

@danielroe
Copy link
Copy Markdown
Member Author

@ibrahim-990 If you are experiencing an issue, please open a new issue with a minimal reproduction 🙏

@ibrahim-990
Copy link
Copy Markdown

i open

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.x breaking-change bug Something isn't working 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

double catch-all doesn't work (both [...slug].vue and a 404.vue)

4 participants