We hit the same issue. Two changes fixed it immediately:
-
Set
runtime: "nodejs"in the middleware config (instead of Edge Runtime) -
Pin Node.js to
22.xviaengines.nodeinpackage.json
No rollback needed, new deployments work fine with these changes.