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

Calling 404 api in middleware causes infinite loop #13673

Closed
farnabaz opened this issue Apr 5, 2022 · 3 comments
Closed

Calling 404 api in middleware causes infinite loop #13673

farnabaz opened this issue Apr 5, 2022 · 3 comments

Comments

@farnabaz
Copy link
Member

farnabaz commented Apr 5, 2022

Environment

------------------------------
- Operating System: `Linux`
- Node Version:     `v16.14.2`
- Nuxt Version:     `3.0.0-27485997.c426f3e`
- Package Manager:  `npm@7.17.0`
- Builder:          `vite`
- User Config:      `-`
- Runtime Modules:  `-`
- Build Modules:    `-`
------------------------------

Reproduction

https://stackblitz.com/edit/node-4gdlnd?file=middleware%2Ftest.global.ts

Start the project and look at browser console, you can see infinite logs there

Screen Shot 2022-04-05 at 4 29 52 PM

Describe the bug

Calling an API inside middleware causes infinite loop when if the API return 404

Additional context

No response

Logs

No response

@lukaszflorczak
Copy link

lukaszflorczak commented Apr 5, 2022

Shouldn't you just add abortNavigation(e) in the catch?

@farnabaz
Copy link
Member Author

farnabaz commented Apr 6, 2022

It never reaches to catch block @lukaszflorczak

@danielroe
Copy link
Member

This is no longer replicable - let me know if you still experience it.

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

No branches or pull requests

3 participants