Next.js Discord

Discord Forum

Weird behavior of redirects from next.config.mjs

Answered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
Hi, I have recently started a project with the next.config.mjs edited with redirects from '/' to '/test'.

Then just now, I decided to create another project at a separate folder and upon running 'npm run dev', and opening it on localhost:3000, I get the redirect from the previous project to localhost:3000/test.

I have deleted the first project and restarted my PC, yet when I run 'npm run dev' on the second project, it still redirects to '/test'.

And even weirder is that I have added redirect to '/abc' on the next.config.mjs file of the second project, and yet, it still redirects to '/test'. Why is the second project keep referencing the next.config.mjs of the first project, even after I have permanently deleted all the files for the first project? And even after I have removed '/test' on the website and hit enter, it reopens back to localhost:3000/test because of the redirect.

Note: I am not running both projects simultaneously and I had made sure the second project run on port 3000.

Anyone know what is causing this issue and how do I resolve it?
Answered by Barbary Lion
Ok the problem automagically disappears after some time...

Could be that I clear cache on browser.
View full answer

1 Reply

Barbary LionOP
Ok the problem automagically disappears after some time...

Could be that I clear cache on browser.
Answer