Closed luisfarzati closed 3 years ago
Update: I found the problem, tsdx uses its own version of TypeScript which is 3.x -- shouldn't probably use TS as a peerDependency
instead?
@luisfarzati Have you found a temporary workaround for this? Have some types that would be very tedious to create in another way.
Yes this is a duplicate of #926 (which partially duplicates #810). One can workaround it with resolutions per https://github.com/formium/tsdx/issues/926#issuecomment-751936109 .
Update: I found the problem, tsdx uses its own version of TypeScript which is 3.x -- shouldn't probably use TS as a
peerDependency
instead?
I didn't write that dependency relationship (there's a handful of things that don't completely work with an "all-in-one" dep), but TSDX itself as well as many of its dependencies rely on specific versions of TypeScript and TS has breaking changes with every minor, so I'm not sure if a peerDep is optimal either.
@luisfarzati can u give more details about ur idea specially i am using typescript 4.7.4 ??
"devDependencies": {
"@size-limit/preset-small-lib": "^8.0.0",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"husky": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"size-limit": "^8.0.0",
"tsdx": "^0.14.1",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
}
Current Behavior
I want to use template literal types provided by TypeScript 4.1:
With the above code, in a blank project created with basic template, the build command ends with:
Note: compilation is successful if running
tsc
directly.Expected behavior
To compile without errors as when running
tsc
directly.Suggested solution(s)
Not sure, probably something around using the same TypeScript version or having proper babel support for newer TypeScript 4.1 features?
Additional context
Your environment