Next should error if both app
and src/app
exist
#75458
Replies: 1 comment
-
having both Why This Happens
Potential Fixes✅ Improve Developer Feedback Example:
✅ Auto-Resolve in Development Mode ✅ Manual Workaround for Now
Conclusion✔ Next.js should throw an error or warning when both folders exist. |
Beta Was this translation helpful? Give feedback.
-
currently, if a project uses
src/app
andapp
is created unintentionally (for example, through a script, command, or some other misconfiguration on the part of the user), next will 404 on every page until the offendingapp
folder is deleted.this is especially frustrating for less experienced users because empty folders are invisible to git! so even if you were to revert the offending script/config/command, every single route will continue to 404 without any feedback whatsoever.
a user might, for example:
> have a fully working next app using
src/app
> attempt to port some configuration from a project that uses
app
> unintentionally create an empty
app
folder> notice all pages are 404ing
> revert changes
> all pages still 404ing. no other console errors.
> check out main branch
> all pages still 404ing. weird. must be the cache.
> delete
node_modules
,.next
, and reinstall> all pages still 404ing.
> waste lots of precious time
maybe there’s a reason this is the behavior, but it seems like erroring (or at least warning) would make sense here
Beta Was this translation helpful? Give feedback.
All reactions