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

Email validation error in v17.8.1 #2915

Closed
vmarannan opened this issue Feb 20, 2023 · 2 comments · Fixed by #2916
Closed

Email validation error in v17.8.1 #2915

vmarannan opened this issue Feb 20, 2023 · 2 comments · Fixed by #2916
Assignees
Labels
bug Bug or defect support Questions, discussions, and general support
Milestone

Comments

@vmarannan
Copy link

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: v18.0
  • module version: v17.8.1
  • environment (e.g. node, browser, native): browser
  • used with (e.g. hapi application, another framework, standalone, ...): hapi
  • any other relevant information:

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

Schema

Joi.object({
  email: Joi.string()
        .email({ tlds: { allow: false } })
})

Data To Validate

{ 
  email: 'somevalid@email.com'
}

Result

TypeError: Cannot read properties of undefined (reading 'has')

What result did you expect?

Validate without error as stated on https://joi.dev/api/?v=17.8.1#stringemailoptions

@vmarannan vmarannan added the support Questions, discussions, and general support label Feb 20, 2023
@charleskoehl
Copy link

charleskoehl commented Feb 21, 2023

I'm getting same with v17.8.1 and v17.8.0 and the same schema:

Joi.object({
  email: Joi.string()
        .email({ tlds: { allow: false } })
})

Fixed by pinning at 17.7.1.

Bug must have been caused by #2909

@Marsup Marsup self-assigned this Feb 21, 2023
@Marsup Marsup added the bug Bug or defect label Feb 21, 2023
@Marsup Marsup added this to the 17.8.2 milestone Feb 21, 2023
Marsup added a commit that referenced this issue Feb 21, 2023
@Marsup
Copy link
Collaborator

Marsup commented Feb 21, 2023

This is fixed in 17.8.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect support Questions, discussions, and general support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants