Next.js Discord

Discord Forum

nextjs 14 app router id searchParam getting deleted in deployed version

Unanswered
Polish posted this in #help-forum
Open in Discord
PolishOP
I have an api route in the route app folder like so:
/app/success/[id]/test/route.ts in there I have a very simple get route right now just export const
GET = async (
  req: Request,
) => { 

  return Response.json({
    url: req.url,
  });
};

my request is appAddress.vercel.app/success/giqOXB8JybLL2V7HEHxLu/test?id=179512-1707861117-67735&env=test

on my request
im getting: {"url":"https://arle-git-feature-order-emails-test-julimancan.vercel.app/success/giqOXB8JybLL2V7HEHxLu/test?env=test"} without the id. This only happens on vercels deployed version and not on development, it also does not happen when I run npm run build and then npm run start
any ideas why this might be happening? I have a way more complex route that is suffering of the same issue, and I need that id to get some payment information!! I dont have any middlewares or weird setup on vercel, everything out of the box.

0 Replies