hapijs / hapijs/joi

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

Open
#2,942 0 comments 0 reactions 0 assignees View on GitHub
support
Dominant language
JavaScript
Stars
21.2k
Forks
1.5k
Avg merge
4h 57m
Merged PRs (30d)
14

Description

#### 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*: joi@17.9.1
* *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.

```js
import Joi from "joi";

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.