Deploying Nuxt3 on Netlify. Dynamic routes ([id].vue) will redirect to the homepage

This issue has troubled me for a very long time.
No matter how I deploy it on Netlify, refreshing dynamic routes will always return to the homepage, unless I enable hash mode.

I am using this project:

It has an example, and the example is also deployed on Netlify, where the same issue exists:

It’s the service worker causing issues. It’s intercepting the request and serving incorrect data. If I select the bypass for network flag:

which will skip using the serving worker, the page works fine. This is not a Netlify issue.

1 Like

Thank you!
After realizing this issue, I disabled PWA and successfully resolved the problem.
For friends facing the same issue, you only need to disable PWA in nuxt.config.ts.

pwa