skip to Main Content

I am working with Nextjs v15. I am creating an application which have some dynamic routes because they are routes depending on usernames (the app is Telegram mini app) and new users can be added in each moment. In my dev environment everything works correctly but when I deploy to Vercel, I cannot access to this route. It doesn´t work.

I saw Vercel runtime logs and I didn´t see relevante. It seems to make a GET request to obtain the route and it returns 200 state, but it doesn´t show the route in the app, it shows the content of the / directory.

An important consideration is that If I remove the cookies, it works fine, it shows correctly the username value.

The route path must be the following: /wallet//sell

This is the code for the page. I think problem is related to the use of cookies, but I think I am using correctly.

Any help will be really useful. Thanks!

interface PageProps {
  params: Promise<{ username: string }>
}

async function SellPage({ params }: PageProps) {
  const { username } = await params
  const cookiesStore = await cookies()
  const sellStep: string = (cookiesStore).get('sellStep')?.value ?? '1'

  return (
    <section className={style.main}>
      <h1>Sell: {sellStep}</h1>
      <h3>{username}</h3>
    </section>
  )
}

2

Answers


  1. If you haven’t resloved this, refer to this Github issue as it addresses a similar problem if not the same Dynamic Routes not displaying intended page and displaying home page instead

    If you have the vercel.json configuration file in your application, remove it. It is mostly likely the cause.

    Login or Signup to reply.
  2. I can confirm that this is an issue with Vercel and Next.js 15.1.0.

    Downgrading to Next.js 15.0.4 worked for me.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search