Closed bayoudhi closed 2 years ago
Hi @bayoudhi,
Interesting, I tried to reproduce the issue with the same Typescript version, without success:
Can you provide your tsconfig
as well ?
Hi @ThomasAribart
I think I found the cause, it's related to preserveSymlinks
option in my tsconfig.json
(as you guessed it's something related to tsconfig
π)
// tsconfig.json
{
"compilerOptions": {
"preserveSymlinks": true
// other options
}
}
When turned on, inferring does not work, if I remove it or turn it off ("preserveSymlinks": false
) inferring works as expected. I used the latest version 2.5.5 btw.
I have a monorepo project with multiple tsconfig
files and modules, and I'm pretty sure preserveSymlinks
is required, I need to check that.
If so can I use this library with my current tsconfig
file? Maybe there's something we can do to make it work with preserveSymlinks
, thanks.
I have a monorepo project with multiple tsconfig files and modules, and I'm pretty sure
preserveSymlinks
is required, I need to check that.
Yep, preserveSymlinks
is required in my case π
Nice catch, thanks ! I'll have a look ! The least I can do is add it as a requirement in the docs.
For what reason do you use preserveSymlinks
options ? Sharing code across services ?
Hi @ThomasAribart, thanks for the reply. I'm sorry for the late response.
To be honest, I'm still not sure what preserveSymlinks
is used for π
it's a monorepo project where some code is shared between different projects/services.
I have a monorepo project with multiple tsconfig files and modules, and I'm pretty sure
preserveSymlinks
is required, I need to check that.Yep,
preserveSymlinks
is required in my case
I figured out that preserveSymlinks
is not required in my project, and the error I received 3 days ago after disabling preserveSymlinks
is not related to this option (I already fixed it) so I can use this library now without any issues π
Thanks again for the fast replies and help π
I'm going to close this issue.
Hey, this is a cool library I really like the idea of inferring TS types from JSON schemas ππ»
Almost all the solutions I found are focused on generating types (via CLIs or code), this library is different & unique.
I found something interesting, all the recent versions (above
1.6.4
) of this library are not working for me, I'm pretty sure my config is correct I'm using Typescript v4 andstrict
mode is enabled.This is what I receive, the inferring is not working π Used the example in the Readme.
The interesting part is this, it looks like
1.6.4
is the most used version in the last week, so I test it and it's working perfectly!Can anyone please confirm that versions above
1.6.4
work? or at least the recent one2.5.5
? Maybe I have something wrong on my side, thanks.This is my config:
v16.16.0
v4.7.4