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

fix(nuxt): throw an error when using unknown route middleware#5323

Merged
pi0 merged 5 commits intomainfrom
fix/mw-error
Jun 10, 2022
Merged

fix(nuxt): throw an error when using unknown route middleware#5323
pi0 merged 5 commits intomainfrom
fix/mw-error

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

resolves nuxt/nuxt#14111

❓ 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

If an invalid middleware was selected, we were drowning out the real error. This adds some comments to layouts/middleware docs about normalising -> kebab-case, and also throws a better error in prod/dev.

📝 Checklist

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

@danielroe danielroe added bug Something isn't working dx 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Jun 7, 2022
@danielroe danielroe requested a review from pi0 June 7, 2022 11:40
@danielroe danielroe self-assigned this Jun 7, 2022
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 7, 2022

Deploy Preview for nuxt3-docs ready!

Name Link
🔨 Latest commit 6d06c82
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62a34883cfa9d00009d6ffae
😎 Deploy Preview https://deploy-preview-5323--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment thread packages/nuxt/src/pages/runtime/router.ts Outdated
@pi0 pi0 changed the title fix(nuxt): improve dx on middleware/layout naming fix(nuxt): improve dx on middleware and layout naming Jun 10, 2022
@pi0 pi0 changed the title fix(nuxt): improve dx on middleware and layout naming fix(nuxt): throw an error when using unknown route middleware Jun 10, 2022
@pi0 pi0 merged commit f6bf4f7 into main Jun 10, 2022
@pi0 pi0 deleted the fix/mw-error branch June 10, 2022 13:35
@pi0 pi0 mentioned this pull request Jun 12, 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 dx 🍰 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.

error with camelcase middleware is hard to see

2 participants