-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1] "[0]" must not be a sparse array item #19
Comments
@albertpeiro I've been unable to reproduce this in Node 18 or Node 16 using the example you gave and some expansion. This is the code I tested with. import BaseJoi from "joi";
import JoiTimezone from "joi-tz";
const Joi = BaseJoi.extend(JoiTimezone);
const querySchema = Joi.object({
rangeStart: Joi.date().required(),
rangeEnd: Joi.date().required(),
rangeTz: Joi.string().required(),
});
const result = querySchema.validate({
rangeStart: '2022-01-01',
rangeEnd: '2022-01-03',
rangeTz: 'Asia/Bangkok',
});
console.log(result); The error you have provided indicates a validation error in a Joi schema containing an |
I'm getting a similar error on my end. I'm also not using My schema:
Error:
Using node v16.x |
Any solution for this problem? |
I installed:
and coded:
Didn't call
.timezone()
yet but it already seems to break BaseJoi. Is there anything I'm doing wrong?I've tried downgrading to joi 16, 17.5, 17.4 but didn't help.
Thank you!
This is the error I get at run time.
The text was updated successfully, but these errors were encountered: