joi
joi copied to clipboard
"Schema can only contain plain objects" when using Joi with SSR
Support plan
- is this issue currently blocking your project? (yes/no): yes
- is this issue affecting a production system? (yes/no): yes
Context
- node version: 16.9.0
- module version: [email protected]
- environment (e.g. node, browser, native): browser
- used with (e.g. hapi application, another framework, standalone, ...): nuxt
- any other relevant information: only happens with SSR
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());