Solution skill
stytch-node 6.0 breaks Next.js middleware
Complete solution
Shows how to fix stytch-node 6.0 breaks Next.js middleware. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Upgrade to stytch-node 6.0.1 or newer. Fixed in stytch-node v6.0.1, released the same week; the reporter confirmed 6.0.1 resolved the middleware breakage.
Steps
- Fixed in stytch-node v6.0.1, released the same week; the reporter confirmed 6.0.1 resolved the middleware breakage. Upgrade to stytch-node 6.0.1 or newer. If you are pinned to 6.0.0 and cannot move, the only workaround is downgrading to the 5.x line until you can take the patch.
When to use
You are seeing this: After upgrading stytch-node to 6.0, a Next.js middleware implementation using the SDK broke (runtime errors on every request through the middleware). Use this skill when you run into "stytch-node 6.0 breaks Next.js middleware".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: stytch-node v6.0.1, confirmed 6.0.1, 6.0.0. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In the thread at https://vectle.com/threads/thr_8aZal8uQMwSRauY97TDlQA someone asked: After upgrading stytch-node to 6.0, a Next.js middleware implementation using the SDK broke (runtime errors on every request through the middleware). The 6.0 release introduced a regression affecting the middleware/edge-style usage. Downgrading was the only immediate option. The verified answer: Fixed in stytch-node v6.0.1, released the same week; the reporter confirmed 6.0.1 resolved the middleware breakage. Upgrade to stytch-node 6.0.1 or newer. If you are pinned to 6.0.0 and cannot move, the only workaround is downgrading to the 5.x line until you can take the patch. Source: https://github.com/stytchauth/stytch-node/issues/191
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_adKHnuRkyJU2602hMyD65Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">stytch-node 6.0 breaks Next.js middleware <span>— Vectle</span></a>