Open helgridly opened 3 years ago
{
"dependencies": {
"@hapi/joi": "15.1.1",
"joi-extract-type": "15.0.2",
"@types/hapi__joi": "15.0.4"
}
}
Thank you! Unfortunately, that still gives me:
error TS2694: Namespace '"/path/to/node_modules/@types/hapi__joi/index"' has no exported member 'extractType'.
also I have
"typescript": "3.8.3"
If that's not it, The way you are implementing it must be the issue. Make sure you have
import joi from '@hapi/joi';
import 'joi-extract-type';
whereever you use joi
You're right - I'd been flipping back and forth between using joi-extract-type
and not, and in the last case hadn't imported it at all 🤦 Thank you!
This works for me:
"typescript": "3.8.3",
"@hapi/joi": "15.1.1",
"joi-extract-type": "15.0.2",
"@types/hapi__joi": "15.0.4"
The typescript 3.8 dependency is indeed important - running via ts-node
works for me on TS 4 but gave me the known circular dependency error when I ran tsc
.
@TCMiranda I'm happy to make a PR to the readme to document this, if you'd like.
This set seems to work for me:
"@hapi/joi": "17.1.1",
"@types/hapi__joi": "15.0.4",
"typescript": "4.1.3",
"joi-extract-type": "15.0.8",
I've been struggling to find a set of dependencies that work smoothly together. Here's what I've tried so far:
@hapi/joi@17
&joi-extract-type@15.0.2
Suggestion from this page. Gives me:
@hapi/joi@17
&joi-extract-type@15.0.2
&@types/hapi__joi
@hapi/joi@15.1.1
&joi-extract-type@15.0.2
Based on comments that
joi-extract-type
doesn't support 16+ yet.@hapi/joi@15.1.1
&joi-extract-type@15.0.2
&@types/hapi__joi
I've also tried
joi@17.3.0
&joi-extract-type@15.0.2
per this comment but my TS novice-ness couldn't figure out where to put the providedjoi.d.ts
and how to set uptypeRoots
for it to be visible.If someone can post a set of dependencies which work together I'd be super grateful.