Skip to content

import { any } does not work on v11 #1311

@nightwolfz

Description

@nightwolfz

Context

  • node version: 8.5.0
  • joi version: 11.0.3
  • environment (node, browser): node and browser
  • used with (hapi, standalone, ...): as custom koa middleware or standalone
  • any other relevant information:

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

Simply importing any of joi types produces an error. It started happening with v11. this seems to be undefined.

import { string, number, any, object } from 'joi'

If I import Joi from 'joi' instead, everything works again.

Which result you had ?

...\node_modules\joi\lib\index.js:28
    if (this._defaults) {
            ^

TypeError: Cannot read property '_defaults' of undefined
    at internals.applyDefaults (...\node_modules\joi\lib\index.js:28:13)
    at root.object (...\node_modules\joi\lib\index.js:102:48)

What did you expect ?

Expected import to work as previous version.

Metadata

Metadata

Assignees

Labels

non issueIssue is not a problem or requires changes

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions