-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation breaks with TypeScript 3.9 #1750
Comments
This is a pretty impossible situation. The thing that's breaking is actually a fix for this typescript bug. That bug has been fixed in the current typescript version, but if I roll back the objection fix that works around that bug, the typings will be broken for everyone still using typescript <= 3.8. Somebody will suggest a major version bump, but that's not going to happen. Those are reserved for bigger changes. The only thing we can do is to revert the fix to make typescript 3.9 work, and then we'll get ten of these issues about things being broken with typescript <= 3.8. |
See this coment microsoft/TypeScript#33460 (comment) |
This is the fix in objection 46c3105. Actually, could somebody try to revert the above fix to see if the problem goes away? It fixed the problem in my small test, but I'd like to be sure it's the only thing broken. |
Hello @koskimas I updated to typescript 3.9.2 and had the above error.
|
@francoisromain Thanks. I'm able to reproduce this now too. I'm baffled. I have no idea how to fix this. There's not a single |
Haha, I may have found a solution by accident. Could you try the |
@koskimas the modification in the
|
That's a bit tricky as the |
dtslint is great, I use it a lot, but be warned that TSLint is deprecated. |
You might be able to maintain backwards compatibility by detecting the TypeScript version and providing different types based on that. Using the example from the TS 3.9 announcement: (playground) interface A {
a: number; // notice this is 'number'
}
interface B {
b: string;
}
interface C {
a?: boolean; // notice this is 'boolean'
b: string;
}
// this type will be different depending on the compiler version
type Result = A & B extends C ? '< 3.9' : '>= 3.9'; |
There's no backwards compatibility issues with the fix. |
You can set: "strict": false,
"strictFunctionTypes": false,
"alwaysStrict": false, in your tsconfig.json as a temp workaround. |
Disabling A better workaround is to import the git branch with the fix. Or fork the repo at the last released version and cherry-pick the fix. |
The fix is now released. No need for any workarounds. |
Upgraded a project from Typescript 3.8.2 to TypeScript 3.9.2.
The project is using the latest Objection (2.1.3).
After the TS upgrade, the project fails to compile with compilation errors related to Objection types.
I suspect this is related to "Stricter Checks on Intersections and Optional Properties" as described here.
The text was updated successfully, but these errors were encountered: