0
votes

I'm trying the get the route parameter in Next 9 and all the examples in the docs make sense and work. Here https://nextjs.org/learn/basics/clean-urls-with-dynamic-routing/dynamic-routing and here https://nextjs.org/docs#imperatively

My problem is that these examples are all in the context of navigating to a page from a link, I would like to load the page directly from the url.

If I go to localhost:3000/meeting/123 it loads the index page, not teh page nested in the meetings folder.

enter image description here

The query parameter shows the 'asPath' key with eth value 'meeting/123' so its all working but it doesn't actually use the code at pages/meeting/[meetingId].js

How do I load a dynamic route directly from the url?

1

1 Answers

1
votes

For anyone else reading this, this works absolutely fine, false alarm, I just forgot to remove my customer server setup that I had for this previously. To do this prior to next 9 you had to set up a custom server and startup using the server. I set everything up for version 9 but was still starting up in teh custom server. Leaving this up here in case anyone else makes teh same mistake.