2

I'm encountering an issue with my Next.js project where I'm receiving the error message: "You cannot have two parallel pages that resolve to the same path." It specifically references /(landing)/page and /(main)/(routes)/(documents)/page. I've checked the route group documentation provided by Next.js, but I'm still unclear on how to resolve this issue effectively. Could you please provide guidance on how to address this error and ensure proper routing in my Next.js application?

enter image description here

I attempted to define routes in Next.js 14 but encountered unresolved paths for pages. I expected the routes to map correctly to their respective pages, but actual results showed unresolved paths.

1 Answer 1

3

Since route groups, aka the folders with (...) are not taken into consideration when resolving path, app/(landing)/page.js and app/(main)/(routes)/(documents)/page.js will match / as it's like you had tow app/page.js, creating a conflict.

So you have to decide which one should render when / is requested. If it's app/(landing)/page.js, you should change app/(main)/(routes)/(documents)/page.js to something like app/(main)/(routes)/(documents)/about/page.js, so it matches /about.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.