Open atstoyanov opened 11 months ago
Adding an empty pages
folder in the root prevents .nextjs from trying to generate static pages from src/pages
. It wasn't obvious to me.
Adding an empty pages folder to the root directory also causes issues with the middleware of Next.js not functioning properly.
@atstoyanov Do you solve the problem or just create empty pages folder at the root of your project?
@creator-woow I've just created an empty pages
folder in the project root with .gitkeep
file inside so it is cloned on other locations.
@jinyoung4478 I'm going to implement a middleware very soon and will have more information.
In general my plan is to restructure the whole project and get rid of the src folder.
Link to the code that reproduces this issue
https://github.com/atstoyanov/nextjs-build-fail
To Reproduce
npm i
andnpm run build
Current vs. Expected behavior
Current: Running
npm run build
results into:Expect: Components in
src/pages
to not to be counted as pages when the/app
folder exists.According to the documentation: https://nextjs.org/docs/app/building-your-application/configuring/src-directory
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Additional context
No response