encodeURIComponent() Changed last 2 weeks

I have an application hosted on here that worked up until sometime in the last couple of weeks. I’d use encodeURIComponent() to be able to send the / character so I can look it up in a mongodb and send it back.

Now every product ID that has a / in it fails to return. Everything still works fine locally(which connects to a hosted mongodb), what could possibly have changed on the backend for this to stop working? or where can I look to start to determine it?

Hi, @ndeedev! Welcome to the Vercel Community :smile:

Thanks for reporting! Some troubleshooting steps to help you get started:

  1. Review your Vercel deployment logs for any errors or warnings related to routing or URL handling.
  2. Try both encodeURIComponent() and non-encoded versions of your product IDs to see if there’s a difference in behavior.
  3. Add logging in your API route to see exactly what value is being received for the product ID.
  4. Review your vercel.json file (if you’re using one) for any routing rules that might be affecting how URLs with ‘/’ are handled.
  5. If you’re using middleware, temporarily remove or modify it to see if it’s causing the issue.
  6. Try to replicate your production environment locally, including environment variables and Vercel CLI, to see if you can reproduce the issue.

Let us know how it goes!

@ndeedev :wave: thanks for flagging this. We’ve identified the issue and reverted the change. It should be fixed now, could you confirm? We’re sorry for the trouble.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.