hoangvu12 – 15-33 Sep 16

I'm using NextJS 13 App dir, when I try to start the project, I got this error
Error: Catch-all must be the last part of the URL.
Error: Catch-all must be the last part of the URL.
I don't know why it cause that, I've seen some github issues and someone mentioned:
It's because you have sub routes inside the catch all route, which for example might [...nextAuth]. If you have sub routes inside catch all routes, it will throw an error. You need to move out the sub routes to anther route.
It's because you have sub routes inside the catch all route, which for example might [...nextAuth]. If you have sub routes inside catch all routes, it will throw an error. You need to move out the sub routes to anther route.
But my app structure looking fine to me, but for some reason it still throwing that error Here is my app structure:
app
(default)
components // store components, don't have any page.tsx inside it
details
[...params]
components // store components, don't have any page.tsx inside it
page.tsx
page.tsx
not-found.tsx
read
layout.tsx
[...params]
components // store components, don't have any page.tsx inside it
icons // store icon components
constants.ts
page.tsx
store.ts
app
(default)
components // store components, don't have any page.tsx inside it
details
[...params]
components // store components, don't have any page.tsx inside it
page.tsx
page.tsx
not-found.tsx
read
layout.tsx
[...params]
components // store components, don't have any page.tsx inside it
icons // store icon components
constants.ts
page.tsx
store.ts
UU
Unknown User214d ago
N
Nguyen214d ago
Oh, I fixed this by moving the icons folder in read/layout/[...params]/components to root/components
UU
Unknown User213d ago