Skip to content

fix: convert defineNuxtRouteMiddleware to legacy middleware#814

Merged
danielroe merged 2 commits intonuxt:mainfrom
wattanx:fix-define-nuxt-route-middleware
Jun 20, 2023
Merged

fix: convert defineNuxtRouteMiddleware to legacy middleware#814
danielroe merged 2 commits intonuxt:mainfrom
wattanx:fix-define-nuxt-route-middleware

Conversation

@wattanx
Copy link
Copy Markdown
Collaborator

@wattanx wattanx commented Jun 18, 2023

🔗 Linked issue

❓ 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

Fixed defineNuxtRouteMiddleware as it needs to be converted to legacy middleware and executed.
Also, abortNavigation has been updated with reference to Nuxt 3.

📝 Checklist

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

@wattanx wattanx requested a review from danielroe June 18, 2023 13:34
@danielroe
Copy link
Copy Markdown
Member

Thank you! 👌

@danielroe danielroe changed the title fix: fix defineNuxtRouteMiddleware to be converted to legacy middleware and upstream abortNavigation fix: convert defineNuxtRouteMiddleware to legacy middleware Jun 20, 2023
@danielroe danielroe merged commit ad4135b into nuxt:main Jun 20, 2023
@danielroe danielroe mentioned this pull request Jun 20, 2023
@Towerism
Copy link
Copy Markdown

Towerism commented Jun 21, 2023

FYI now that this has been released to npm, we cannot use the latest nuxt bridge-edge. Trying to start our application results in a blank page. And an error in the console that states:

composables.mjs:126 Uncaught (in promise) TypeError: Cannot set properties of undefined (setting '_processingMiddleware')
    at _callee$ (composables.mjs:126:40)
    at tryCatch (runtime.js:64:15)
    at Generator.invoke (runtime.js:299:1)
    at Generator.eval [as next] (runtime.js:124:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:25:1)
    at eval (asyncToGenerator.js:32:1)
    at new Promise (<anonymous>)
    at eval (asyncToGenerator.js:21:1)
    at eval (composables.mjs:136:4)

image

For now, we have no choice but to use an older version 3.0.0-28109745.a6e6787 which is the last release that doesn't contain this change.

@wattanx
Copy link
Copy Markdown
Collaborator Author

wattanx commented Jun 22, 2023

@Towerism
If possible, could you provide a reproduction?
It will help us to resolve that error quickly.
(It would be helpful if you could also create an issue.)

@Towerism
Copy link
Copy Markdown

@wattanx created issue. includes reproduction. #826

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants