-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Type 'Entity' does not satisfy the constraint 'ObjectLiteral'. update(): UpdateQueryBuilder<Entity>; #9331
Comments
Hello @pleerock We have the same concern reported by users of the See you and have a nice day ! |
Thank @Romakita. |
Can confirm. |
Maybe https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#unconstrained-generics-no-longer-assignable-to is relevant to explain this issue. Let me add a minimun example of my issue: import { Repository } from 'typeorm';
interface RepositoryWrapper<T> {
repository: Repository<T>
} Consider ts playground references: As metioned in TS 4.8 release notes linked above, T is no longer assignable to Having said that, just to know, why typeorm's ./node_modules/typeorm/repository/Repository.d.ts export declare class Repository<Entity extends ObjectLiteral> {
// ...
} Having a look at ./node_modules/typeorm/common/ObjectLiteral.d.ts /**
* Interface of the simple literal object with any string keys.
*/
export interface ObjectLiteral {
[key: string]: any;
} It seems this constraint is the cause of the issue, do we have a reason for keeping it? |
We are using version
|
fix: typescript 4.8 type issues typeorm#9331 (typeorm#9357)
Expected Behavior
Just Build without any error.
Issue Description
Build Time error.
It Work perfectly in development. When run build (tsc -p .) then getting this error below.
Steps to Reproduce
My Environment
Additional Context
Relevant Database Driver(s)
aurora-mysql
aurora-postgres
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
spanner
sqlite
sqlite-abstract
sqljs
sqlserver
The text was updated successfully, but these errors were encountered: