joi icon indicating copy to clipboard operation
joi copied to clipboard

Property "local" does not exist on type "ErrorReport"

Open EdMSL opened this issue 4 years ago • 1 comments

  • is this issue currently blocking your project?: no
  • is this issue affecting a production system?: no

Context

  • node version: 14.x
  • module version with issue: 17.4.2
  • last module version without issue:
  • environment (e.g. node, browser, native): all
  • used with (e.g. hapi application, another framework, standalone, ...): all
  • any other relevant information: typescript type error

What are you trying to achieve or the steps to reproduce?

Use

 const schema = Joi.object({
    foo: Joi.number().min(0).error((errors) => {

        return new Error('found errors with ' + errors.map((err) => `${err.local.key}(${err.local.limit}) with value ${err.local.value}`).join(' and '));
    })
});

What was the result you got?

Compilation error Property "local" does not exist on type "ErrorReport"

What result did you expect?

No ts error.

If I set @ts-ignore all works good.

EdMSL avatar Aug 21 '21 09:08 EdMSL

Still not resolved ...

eugene-ganshin avatar May 22 '22 13:05 eugene-ganshin

any pointers on this one?

hirvesh avatar Sep 05 '22 10:09 hirvesh

Fixed #2788.

Marsup avatar Sep 20 '22 08:09 Marsup