The validate function call currently loses the dynamic this binding. Thus, if a standard validator's validate function is a class method that makes use of this, it will be undefined, as is the case when using TypeBox's standard schema adapter.
--- /dev/null
+---
+'@sveltejs/kit': patch
+---
+
+fix: preserve `this` when invoking standard validator
return async (arg) => {
// Get event before async validation to ensure it's available in server environments without AsyncLocalStorage, too
const { event, state } = get_request_store();
- const validate = validate_or_fn['~standard'].validate;
-
- const result = await validate(arg);
+ // access property and call method in one go to preserve potential this context
+ const result = await validate_or_fn['~standard'].validate(arg);
// if the `issues` field exists, the validation failed
if (result.issues) {