question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript 2.7.1 update cause repository.save(entity) error

See original GitHub issue

Issue type:

[ ] question [x ] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [x ] postgres [ ] sqlite [ ] sqljs [ ] websql

TypeORM version:

[ x] latest [ ] @next [ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

When i update my typescript version to 2.7.1 my application’s build broken with the follow error:

PS C:\dsv\nest-api> npm run start:prod

nest-typescript-starter@1.0.0 prestart:prod C:\dsv\nest-api tsc

src/modules/common/services/base-data.service.ts(46,65): error TS2321: Excessive stack depth comparing types ‘T’ and ‘DeepPartial<T>’. src/modules/common/services/base-data.service.ts(67,65): error TS2345: Argument of type ‘T’ is not assignable to parameter of type ‘DeepPartial<T>’.

npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! nest-typescript-starter@1.0.0 prestart:prod: tsc npm ERR! Exit status 2

The service code is the follow:

export abstract class BaseDataService<T extends BaseModel> implements ICrudService<T>{

    constructor() {

    }
   
    ... other crud methods   

    public abstract getRepository(): Repository<T>;
    
    public async save(entity: T): Promise<T> {
        try {
            const response: T = await this.getRepository().save(entity);
            return response;
        } catch (error) {
            throw new BadGatewayException('ERROR.BASEDATASERVICE.SAVE');
        }
   }

}

Someone know why this is happening?

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
pleerockcommented, Mar 10, 2019

Can you guys please check it in the 0.2.15-rc.1 ? (npm i typeorm@0.2.15-rc.1)

2reactions
EduardsEcommented, Apr 4, 2019

Downgrading to 0.2.15-rc.1 did not fix the issue for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CrudRepository save() throws "Row was updated or deleted ...
The error you are seeing means Hibernate tried to update an entity, but the update statement actually updated 0 rows.
Read more >
JpaRepository (Spring Data JPA Parent 3.0.0 API)
Saves an entity and flushes changes instantly. Parameters: entity - entity to be saved. Must not be null.
Read more >
vue-template-compiler - npm
This package can be used to pre-compile Vue 2.0 templates into render functions to avoid runtime-compilation overhead and CSP restrictions.
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
Bug :1523 - "[IDEA] Offload work by distributing trivial ebuild maintenance to users, ... Bug:54727 - "gentoo-stats --update fails with error message" ...
Read more >
Next.js 11 - User Registration and Login Tutorial with Example ...
/api/users/[id] - PUT - secure route for updating a user. ... If the error is an object with the name 'UnauthorizedError' it means...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found