Next.js Discord

Discord Forum

404 on Dynamic Routes

Unanswered
Schillerstövare posted this in #help-forum
Open in Discord
SchillerstövareOP
Hi everyone,

I am an experienced web dev but new to Next.js, specifically the SSR aspect.

I am trying to create a master/detail view with a list of entitlements on the left hand side and entitlement detail on the right hand side.

The entitlement detail will only be displayed when an item in the list is clicked.

I am using dynamic routes with the app router to achieve this.

Example:
/entitlements/[id]

When I am at the route /entitlements and click a <Link> tag to navigate to /entitlements/1 it works as expected.

When I enter /entitlements/1 directly into the url bar I get a 404.

I think I am missing something simple but can’t find it documented anywhere.

Any help would be much appreciated.

1 Reply

SchillerstövareOP
Here is my app structure for the routing I am using, and the component I am trying to display using the dynamic routing.

I know how many entitlements there will be a at build time, but this value will grow over time.