## The problem

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.

## What works

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