3

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/[username]/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>
  )
}

3 Answers 3

3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Issue:

I encountered an issue with my Next.js 15.2.3 project where dynamic routes worked locally but not in production. After spending a lot of time trying to resolve it, I found the solution.

Solution:

When I migrated the project from Vite to Next.js, I had a vercel.json configuration file. The dynamic routes were not working in production due to this file.

The fix: I deleted the vercel.json file and pushed the changes to Vercel. After doing this, the dynamic routes started working correctly in production.

Hope this helps someone else facing the same issue!

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.