Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using an async method inside an anonymous middleware causes a nuxt instance unavailable #18459

Closed
ptoussai opened this issue Jan 23, 2023 · 2 comments · Fixed by #18460
Closed

Comments

@ptoussai
Copy link

Environment


  • Operating System: Darwin
  • Node Version: v18.9.0
  • Nuxt Version: 3.0.0
  • Nitro Version: 1.0.0
  • Package Manager: yarn@3.3.1
  • Builder: vite
  • User Config: workspaceDir, vite, server, runtimeConfig, hooks, router, head, css, buildModules, render, build
  • Runtime Modules: -
  • Build Modules: @nuxt/postcss8@1.1.3

Reproduction

https://stackblitz.com/edit/nuxt-starter-beockb?file=pages%2Findex.vue

Describe the bug

This simple example as seen in #14269 still does not work and nuxt instance unavailable is thrown on the server.

<script setup>
definePageMeta({
  middleware: defineNuxtRouteMiddleware(async () => {
    await new Promise((resolve) => setTimeout(resolve, 200)); // having await in
    return navigateTo('/auth');
  }),
});
</script>

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

This should be resolved in the edge channel, or in the next release.

Let me know if not and I'll reopen.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
@ptoussai
Copy link
Author

ptoussai commented Jan 23, 2023

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

Successfully merging a pull request may close this issue.

2 participants