You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue with the Except type in type-fest versions 3.7.0 and higher (including v3.8.0), but this problem is not present in type-fest version 3.6.1.
Specifically, when I tried to create a declaration file using thetsc --emitDeclarationOnly command, the compiler expanded certain expressions using Except. However, this expansion did not occur in version 3.6.1. Additionally, in some cases, TypeScript version 4.9.5 would truncate the declaration file due to a bug handling the expansion of Except. (this issue has been resolved in TypeScript 5.0, but I cannot find any related bug report in their repo).
Example
// Note: BoxProps contains many properties to implement a "styled system"exportinterfaceTextPropsextendsExcept<BoxProps,'textStyle'>{variant?: keyofTextStyles;}typeTextVariantProps=Except<TextProps,'variant'>;exportconstHeading1=forwardRef((props: TextVariantProps,ref: Ref<HTMLElement>)=>(<Textvariant="heading1"ref={ref}{...props}/>));
I detected the Except expansion because the compiler started to fail in another project that consumed the .d.ts. It failed because TS 4.9.5 truncated the output when the expansion was big. I was able to solve the problem by downgrading to [email protected].
While this is not only an issue with type-fest (it's also an issue intsc v4.9.5), perhaps revisiting of the changes introduced in #560 may help.
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
The funding will be given to active contributors.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
I didn't have any success on reproducing the issue with smaller cases. I think that React's forwardRef definition and the addition of & to Except may have to do with the tsc expansion.
At the moment, I pinned type-fest version to v3.6.1
I encountered an issue with the
Except
type in type-fest versions 3.7.0 and higher (including v3.8.0), but this problem is not present in type-fest version 3.6.1.Specifically, when I tried to create a declaration file using the
tsc --emitDeclarationOnly
command, the compiler expanded certain expressions usingExcept
. However, this expansion did not occur in version 3.6.1. Additionally, in some cases, TypeScript version 4.9.5 would truncate the declaration file due to a bug handling the expansion ofExcept
. (this issue has been resolved in TypeScript 5.0, but I cannot find any related bug report in their repo).Example
Declaration emitted when using type-fest 3.6.1:
Declaration emitted when using type-fest 3.8.0 (or any version higher than 3.6.1):
I detected the
Except
expansion because the compiler started to fail in another project that consumed the.d.ts
. It failed because TS 4.9.5 truncated the output when the expansion was big. I was able to solve the problem by downgrading to[email protected]
.While this is not only an issue with type-fest (it's also an issue in
tsc
v4.9.5), perhaps revisiting of the changes introduced in #560 may help.Upvote & Fund
The text was updated successfully, but these errors were encountered: