Next.js Discord

Discord Forum

Draft mode is 404 only on production

Unanswered
Masai Lion posted this in #help-forum
Open in Discord
Masai LionOP
Hi team,
I'm struggling to understand why draft mode works inconsistently in production, whereas it works 100% in development mode. I'm looking at the production logs on Vercel and it seems that the draft request (with draft cookie data already set) is handled twice - once by the edge middleware (returns 200) and one as a serverless function (returns 404). The browser only sees the 404 version.
What's particularly frustrating is that I have draft mode URLs for several content types - they all use the same code pattern to provide functionality and yet some content types fail in production whereas others work correctly.
Any suggestions or pointers as to what might be causing this issue would be greatly appreciated - I feel like I'm shooting in the dark here.

0 Replies