Support Forums

404 on refresh page

Hi, netlify team!

We have a problem on our deploy-preview link. Every time we refresh page we get 404 page (except main page, its fine).
I’ve checked some topics and there is such a bug with react-router. But we don’t use it.
We use nextjs and deploy it on netlify.
It can be useful to know that we put basePath in next.config.js. Something like “/directory”.

What can we do with this bag? It has some influence on our production, so it’s critical

hi there, can you check and see if this is applicable to your situation?


yep, I’ve already tried it. But it doesn’t work for next.js

Hi @alisakova

basePath becomes the path where the app is located. By default the path is /, so the app is located at https://example.com/, but if you set basePath to /app, the app is now located at https://example.com/app/. I can only guess the app you have deployed is available at the root of the domain (ie. /) so basePath should remain unset.

Are you are using the Essential Next.js Build Plugin, or are you running next export to build a static site?

hi @coelmay
We use route like this https://example.com/app, that’s why we need to have basePath.
Also we use Essential Next.js Build Plugin

1 Like

Hey @alisakova,

Could you share your URL that’s causing problems?