Next.js Dynamic Route doesn't work on Cloudflare Pages - Stack Overflow

I've deployed my next.js app to cloudflare pages. Almost things work fine but only Dynamic Route

I've deployed my next.js app to cloudflare pages.
Almost things work fine but only Dynamic Route don't work.
I have a dynamic route like this: app/[color]/page.js
So the url would be like this: /rgb_127_127_127, /hex_ff_00_ff, /hex_ff_ff_00, etc.

I used @opennextjs/cloudflare and wrangler to deploy
And commands like this:

  "scripts": {
    "dev": "next dev --turbopack",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "preview": "opennextjs-cloudflare && wrangler dev",
    "deploy": "opennextjs-cloudflare && wrangler deploy",
    "cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"
  }

If I access to /rgb_127_127_127, it shows me Internal Server Error on local and cloudflare both.
How can I solve this?
Thank you in advance.

I've deployed my next.js app to cloudflare pages.
Almost things work fine but only Dynamic Route don't work.
I have a dynamic route like this: app/[color]/page.js
So the url would be like this: /rgb_127_127_127, /hex_ff_00_ff, /hex_ff_ff_00, etc.

I used @opennextjs/cloudflare and wrangler to deploy
And commands like this:

  "scripts": {
    "dev": "next dev --turbopack",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "preview": "opennextjs-cloudflare && wrangler dev",
    "deploy": "opennextjs-cloudflare && wrangler deploy",
    "cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"
  }

If I access to /rgb_127_127_127, it shows me Internal Server Error on local and cloudflare both.
How can I solve this?
Thank you in advance.

Share Improve this question edited Mar 11 at 13:38 Orest Stryhunov asked Mar 11 at 8:34 Orest StryhunovOrest Stryhunov 1316 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Can you try to change the next version to 15.1.7? I also had internal server errors (not only related to dynamic routes) and downgrading next to 15.1.7 solved the issue

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744806710a4594820.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信