Closed wy193777 closed 3 years ago
Is it possible the hapi types you are using are referencing another joi types file and the two are in conflict?
I already uninstalled @type/hapijoi. But seems query -> RouteOptionsResponseSchema -> Schema still comes from @type/hapijoi.
Yeah, someone will have to fix it over there...
Other @hapi/xxx projects also use @hapi/hapi__joi as a dependency, I guess everyone of them need to be fixed?
No because those are internal usages.
After change @type/hapi__hapi's type file, I got the following error, do you have any idea on how to debug it? I don't know if this a problem on my code or on hapi itself.
.\Backend\node_modules\@hapi\hoek\lib\error.js:23
Error.captureStackTrace(this, exports.assert);
^
Error: Schema can only contain plain objects
at new module.exports (.\Backend\node_modules\@hapi\hoek\lib\error.js:23:19)
at module.exports (.\Backend\node_modules\@hapi\hoek\lib\assert.js:20:11)
at Object.internals.schema (.\Backend\node_modules\joi\lib\compile.js:87:5)
at Object.exports.schema (.\Backend\node_modules\joi\lib\compile.js:16:26)
at internals.Base.$_compile (.\Backend\node_modules\joi\lib\base.js:645:24)
at .\Backend\node_modules\joi\lib\types\keys.js:256:92
at Object.exports.tryWithPath (.\Backend\node_modules\joi\lib\common.js:176:16)
at internals.Base.method [as keys] (.\Backend\node_modules\joi\lib\types\keys.js:256:32)
at Object.internals.schema (.\Backend\node_modules\joi\lib\compile.js:89:25)
at Object.exports.schema (.\Backend\node_modules\joi\lib\compile.js:16:26)
The problem is on my code. But it's a little bit hard with this kind of error stack trace.
Ever got it fixed?
After update dependencies the problem disappeared.
updating which dependency? @wy193777
Support plan
Context
How can we help?
Got type error on route.options.validate.query when using Joi.object()
Error