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

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

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

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

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/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.

@danielroedanielroe 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 pi0June 7, 2022 11:40
@danielroedanielroe self-assigned this Jun 7, 2022
@netlify

netlifyBot commented Jun 7, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commit6d06c82
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62a34883cfa9d00009d6ffae
😎 Deploy Previewhttps://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 threadpackages/nuxt/src/pages/runtime/router.ts Outdated
pi0
pi0 approved these changes Jun 10, 2022
@pi0pi0 changed the title fix(nuxt): improve dx on middleware/layout namingfix(nuxt): improve dx on middleware and layout namingJun 10, 2022
@pi0pi0 changed the title fix(nuxt): improve dx on middleware and layout namingfix(nuxt): throw an error when using unknown route middlewareJun 10, 2022
@pi0
pi0 merged commit f6bf4f7 into mainJun 10, 2022
@pi0
pi0 deleted the fix/mw-error branch June 10, 2022 13:35
@pi0pi0 mentioned this pull request Jun 12, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't workingdx🍰 p2-nice-to-havePriority 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

@danielroe@pi0