hapijs / joi

The most powerful data validation library for JS
Other
20.95k stars 1.51k forks source link

"Schema can only contain plain objects" when using Joi with SSR #2942

Open MajorMeerkatThe3rd opened 1 year ago

MajorMeerkatThe3rd commented 1 year ago

Support plan

Context

How can we help?

When using the pattern command, I get the error "Schema can only contain plain objects". This only happens when trying to enable SSR.

import Joi from "joi";

// copy pasted from the example
const schema = Joi.object({ a: Joi.string() }).pattern(/\w\d/, Joi.boolean());