TCMiranda / joi-extract-type

Provides native type extraction from Joi schemas for Typescript
MIT License
151 stars 27 forks source link

Invalid module name in augmentation- index.d.ts #23

Closed janders4 closed 4 years ago

janders4 commented 4 years ago

Hi, i'm looking for some help with the following issue:

Using

joi-extract-type: 15.0.1
@hapi/joi": 15.1.1

I'm importing in with the following: import 'joi-extract-type'

In the node module file index.d.ts i'm having the following error: _module "@hapi/joi" Invalid module name in augmentation. Module '@hapi/joi' resolves to an untyped module at '/Users/johnanderson/Documents/GitHub/error-handling-class-spike/nodemodules/@hapi/joi/lib/index.js', which cannot be augmented.ts(2665)

Thanks

John

TCMiranda commented 4 years ago

Uhmm @janders4 can you try installing also @types/hapi__joi ?

evanshortiss commented 4 years ago

@TCMiranda I've just run into the same issue. It looks like they've changed the definitions recently so I think it's linked to that.

evanshortiss commented 4 years ago

Here's the error I'm seeing:

node_modules/joi-extract-type/dist/index.d.ts:9:16 - error TS2649: Cannot augment module 'Joi' with value exports because it resolves to a non-module entity.
TCMiranda commented 4 years ago

Hello @evanshortiss you are right, i'll update the package.json dependencies to disallow those definitions.

TCMiranda commented 4 years ago

Updated on 15.0.2, if you could test on your setup, it would be awesome. Thanks

janders4 commented 4 years ago

@TCMiranda, thanks, all is working now