nuxt
nuxt copied to clipboard
API Request URLs Open in New Tab Redirect to 404 Page
I am using Nuxt.js for my project and I have encountered an issue where opening API request URLs in a new tab results in a 404 page. It appears that the service worker (SW) is intercepting the routing. However, if I perform a hard refresh, the page correctly returns the JSON data from the API.
Steps to reproduce:
- Open an API request URL in a new tab.
- Observe the 404 error page.
- Perform a hard refresh on the new tab.
- Observe the correct JSON data being returned.
Expected behavior: When opening an API request URL in a new tab, it should directly return the JSON data without needing a hard refresh.
Current behavior: Opening an API request URL in a new tab results in a 404 page until a hard refresh is performed.
Possible cause: It seems the service worker might be intercepting the route and causing the 404 page issue.
How to fix: Looking for suggestions on how to prevent the service worker from intercepting API request URLs or any other potential fixes for this issue.
Environment: Nuxt.js version: 3.11.2 Browser: Chrome 124.0.6367.209 Operating System: MacOS 14.5 Thank you for your help!