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

Skip to content

Conversation

Mini-ghost
Copy link
Member

πŸ”— Linked issue

Resolve #26612

πŸ“š Description

When attempting the reproduction of linked issue, it results in a warning message advising users not to utilize useRoute within middleware. This advice is misleading in this context.

In this PR, I tryed to update the return value in isProcessingMiddleware().

Since the Nuxt 3.5.0, both asynchronous and synchronous middleware have been able to properly access the Nuxt instance. However, if useNuxtApp() within isProcessingMiddleware throws an error, it conclusively indicates that the execution is not happening within a plugin, Nuxt hook, Nuxt middleware, or Vue setup function.

Thank you for reviewing this. If there's anything I might have overlooked, please don't hesitate to let me know.

Copy link

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

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.

False positive warning about calling useRoute within middleware
2 participants