Type DeepPartial issue when used with generics
Problem
Issue type: [ x ] question [ x ] bug report [ ] feature request [ ] documentation issue Database system/driver: [ ] `cordova` [ ] `mongodb` [ ] `mssql` [ ] `mysql` / `mariadb` [ ] `oracle` [ ] `postgres` [ ] `sqlite` [ ] `sqljs` [ ] `react-native` [ ] `expo` TypeORM version: [ x ] `latest` [ x ] `@next` [ x ] `0.x.x` (or put your version here) Steps to reproduce or a small repository showing the problem: [code block] Typescript is giving me error on entity.createdAt, entity.updatedAt , entity.savedBy. [ts] Type 'Date' is not assignable to type 'DeepPartial<E["createdAt"]>'. But if I change the DeepPartial type from: export declare type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]> }; to export declare type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]> | T[P] }; the error disappears. Could we change the DeepPartial type ? Regards Hugo <!-- To answer those questions you need to put "x" inside the square brackets, for example: [x] `mysql` [ ] `postgres` Also, please format your code properly (by taking code blocks into [code block]) !>
Error Output
error on entity.createdAt, entity.updatedAt , entity.savedBy.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Type DeepPartial issue when used with generics
I too have this issue and was able to fix it in the same way [code block] But then I run into new problems, `Excessive stack depth comparing types` [code block]
Trust Score
1 verification
- 1
I too have this issue and was able to fix it in the same way
I too have this issue and was able to fix it in the same way
- 2
But then I run into new problems, `Excessive stack depth comparing types`
But then I run into new problems, `Excessive stack depth comparing types`
Validation
Resolved in typeorm/typeorm GitHub issue #2904. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep