Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

[🐛 Bug]: navigating directly to a dynamic route  #163

@dodrian

Description

@dodrian

Cli version

0.7.0

Next.js related information

 Operating System:       Platform: darwin       Arch: arm64       Version: Darwin Kernel Version 21.6.0: Mon Dec 19 20:46:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T8101     Binaries:       Node: 19.6.0       npm: 9.4.0       Yarn: 1.22.19       pnpm: N/A     Relevant packages:       next: 13.3.0       eslint-config-next: 13.3.0       react: 18.2.0       react-dom: 18.2.0

Vercel version

28.18.3

Description

I've seen this problem mentioned in a few other places but I don't see an issue specifically documenting it with steps to reproduce.

The file src/pages/members/[userId]/index.tsx should allow you to paste the url localhost:3000/members/1234 into the browsers and have the code in the index.tsx file render the page. This works fine with the default next commands npm run dev and npm run build && npm run start, but when you do this with npx @cloudflare/next-on-pages and npx wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat --port=3000 (or upload to the cloudflare pages environment) navigating directly to the page returns a 404 page.

Navigating to a member page with a Next <Link> component, or using Next's router.push(url) works fine in the cloudflare environment.

Reproduction

https://github.com/dodrian/pages-next-app

From the root index page there are links (including dynamically generated links) to different member pages, and an input box with a button that will use router.push to navigate you to a member page. Following these links works fine, but if you then reload the page it returns a 404.

Additional Information

No response

Would you like to help?

  • Would you like to help fixing this bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions