Open dragosrotaru opened 5 years ago
@DragosRotaru I am not sure if you still have the issue. I just had a similar one in one project of mine. At the end it was related, as far as I have discovered, to the fact that the dependency io-ts-types (in your use case) is a dependency of your module (@huckleberryai/core). You should move it to a to dev dependency and add it also as a peer dependency. Once you add io-ts-types to your main project (the external module that is using @huckleberryai/core) it should work as expected.
In my experience, the only thing that worked was to add
export { OptionFromNullableC } from "io-ts-types";
to every place I had
import "io-ts-types/lib/optionFromNullable"
HtH, Dan
π Bug report
Current Behavior
When I extend a Type from an external module, I get the error mentioned in the issue title.
To fix the error, I have to add the following import:
import "io-ts-types/lib/optionFromNullable"
In my @huckleberryai/core package:
Expected behavior
I expect that when I write a Codec that uses an io-ts-type, I can export that codec in our internal packages and import it without issues.
Suggested solution(s)
I'm not really sure how you would fix this. Would love for someone to explain to me what is going on
Additional context
I should also mention that
Your environment