Search code examples
reactjsnext.jsvercelnextjs-dynamic-routing

Nextjs dynamic route page return 403 Forbidden error for only one specific user dynamic route


I have my route defined as patients/[userID].tsx in pages dir.

When I tried to access one of the specific active userID (eg. patients/7917067d) it gave 403 Forbidden error in prod only, In dev, it is working fine.

FYI, when I enter the wrong userId it gives 404 which is correct behaviour but don't know why only this userId which is correct gives a 403 error.

NOTE: I am using Static Generation with Client-side data fetching

enter image description here


Solution

  • Upgrading the nextjs package to 12.3.3 did the work.

    Refer this github issue for more details.