Nuxt - Some pages doesn't redirect to the right page correctly after refresh

Hi
I’m stuck with a routing issue I think. Some pages of my website doesn’t load the right page after refresh although it’s fine on my local server and surge.sh

So the pages that have issue are the contact and quote (start a project) page

Steps to reproduce:

  1. Go directly to https://webcodastatic.netlify.app/contact or https://webcodastatic.netlify.app/quote
  2. Click the logo or other top menu links

It’s fine if you go to https://webcodastatic.surge.sh/contact directly and do the steps above. Note that the webcodastatic.surge.sh has exactly the same files which I downloaded from the deploy log (https://app.netlify.com/sites/webcodastatic/deploys/5f1f6c58c4e40400087194bb) and uploaded to surge.sh.

Built using Nuxt 2.14.0 (full static - https://nuxtjs.org/blog/going-full-static)
nuxt.config.js
mode: ‘universal’,
target: ‘static’,

It’s fine for other pages except those two.

Thanks

Hello,

It looks like your site has a service worker. Note that if you observe the browser dev tools console, you’ll see a 404 when you do the steps you described. Those 404s are coming from your sw.js file. You’ll probably want to remove and deregister your service worker for things to work better. For additional information, you’ll want to read the following post here: [Support Guide] Understanding & unregistering service workers.

I’ve removed service worker from the codebase and unregister it from my browsers, but it still has the issue. I’m wondering why…

My last build without service worker: https://app.netlify.com/sites/webcodastatic/deploys/5f2c0620902b0e0008731a13

I’ve also uploaded the deploy result to surge: https://webcodastatic.surge.sh/contact/

Hi, @info_webcoda. The URLs are working correctly when I test. Did you resolve the issue?

If not, it would help to know exactly what you are seeing which is incorrect. Also, for the incorrect pageload, it would also help us to have the ``xnf-request-id` header.

There more information about this header here:

If that header isn’t available for any reason, please send the information it replaces (or as many of these details as possible). Those details are:

  • the complete URL requested
  • the IP address for the system making the request
  • the IP address for the CDN node that responded
  • the day of the request
  • the time of the request
  • the timezone the time is in