I've got a project setup in NextJS 13.4.7 and am wanting to use the src/
directory structure. I've got my app
folder which has the following structure:
app/
[lang]/
page.tsx
layout.tsx
This works fine when it's outside the src/
structure, but when I move everything into it the routes are not recognised anymore and instead I get a 404 showing up. Unless I go to /src in the browser - then the routes show up as expected.
I have a middleware file which does the localisation, should that be moved inside the src/
folder structure as well or kept in the route?
I have deleted the .next
folder from the project before re-running npm run dev
here as well, as others have suggested: Moving Pages folder in Next.js application to src folder
Cheers!