Skip to content
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

import { any } does not work on v11 #1311

Closed
nightwolfz opened this issue Sep 21, 2017 · 4 comments
Closed

import { any } does not work on v11 #1311

nightwolfz opened this issue Sep 21, 2017 · 4 comments
Assignees
Labels
non issue Issue is not a problem or requires changes
Milestone

Comments

@nightwolfz
Copy link

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.

@Marsup
Copy link
Collaborator

Marsup commented Sep 21, 2017

Yes, it won't work anymore, I need the binding to the joi instance, can't think of any way to save you, sorry.

kanongil added a commit to kanongil/joi that referenced this issue Sep 21, 2017
@kanongil
Copy link
Contributor

Maybe I can, check #1312.

@Marsup Marsup closed this as completed in 491ab9d Oct 8, 2017
@Marsup Marsup added the bug Bug or defect label Oct 8, 2017
@Marsup Marsup self-assigned this Oct 8, 2017
@Marsup Marsup added this to the 11.3.1 milestone Oct 8, 2017
@Marsup
Copy link
Collaborator

Marsup commented Oct 8, 2017

Found a way after all, thanks for the effort Gil ! 👍

@Marsup Marsup added non issue Issue is not a problem or requires changes and removed bug Bug or defect labels Oct 9, 2017
@Marsup
Copy link
Collaborator

Marsup commented Oct 9, 2017

Actually, sorry, I was tired, it's impossible, I'm going to error on those cases.

Marsup added a commit that referenced this issue Oct 9, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
non issue Issue is not a problem or requires changes
Projects
None yet
Development

No branches or pull requests

3 participants