Dynamic Routes not working

Hello,

I have a frontend (e-commerce) that has dynamic routes. They work without any issues in Vercel, but in Cloudflare Pages, dynamic routes return a 404.

The page that is giving the 404:
https://github.com/medusajs/nextjs-starter-medusa/blob/main/src/pages/order/details/%5Bid%5D.tsx

But on the other hand, products (also dynamic) are showing correctly:
https://github.com/medusajs/nextjs-starter-medusa/blob/main/src/pages/products/%5Bhandle%5D.tsx

Any help to try and solve this would be really appreciated.

Thank you!