Skip to content
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

TypeScript compilation fails with version v0.2.27 : error TS2611 #6805

Closed
rbutera opened this issue Sep 29, 2020 · 10 comments · Fixed by #6810
Closed

TypeScript compilation fails with version v0.2.27 : error TS2611 #6805

rbutera opened this issue Sep 29, 2020 · 10 comments · Fixed by #6810
Labels
bug regression worked in previous version and doesn't work in current

Comments

@rbutera
Copy link

rbutera commented Sep 29, 2020

Issue type:

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

TypeORM version:

[x] latest
[x] 0.2.27

Steps to reproduce or a small repository showing the problem:

The issue appears to be related to MongoEntityManager.d.ts:

[node_modules/typeorm/entity-manager/MongoEntityManager.d.ts:27:9 - error TS2611: 'queryRunner' is defined as a property in class 'EntityManager', but is overridden here in 'MongoEntityManager' as an accessor.

27     get queryRunner(): MongoQueryRunner;
           ~~~~~~~~~~~

Found 1 error(s).

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I manually installed 0.2.26 and compilation succeeded.

@imnotjames
Copy link
Contributor

imnotjames commented Sep 29, 2020

What version of typescript are you running this with?

@Cristiandi
Copy link

I'm using the version 4.0.3 of typescript, same problem.

@anhpt97
Copy link

anhpt97 commented Sep 30, 2020

I also ran into the same problem as @Cristiandi. Please fix this.

P.S. The version of TypeScript that I am using is 4.0.3.

@kayotimoteo
Copy link

Same problem here TypeScript version 4.0.3.

@imnotjames
Copy link
Contributor

We aren't currently using 4.0 yet - perhaps there's a compatibility feature we didn't enable for the latest release?

@imnotjames
Copy link
Contributor

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#properties-overriding-accessors-and-vice-versa-is-an-error

Looks like the issue was introduced in the type definitions as of Typescript 3.7 - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html - because there's a problem with overriding properties with accessors.

And for some reason our build wasn't using this until 0.2.27 - not sure the cause there, as we should have been updating over time.

If we drop to Typescript 3.6.0 it should fix this issue - but it does mean that TypeORM as a project is stuck on that until whenever we can create a breaking change. What a pain. :|

@imnotjames imnotjames added bug regression worked in previous version and doesn't work in current labels Sep 30, 2020
imnotjames added a commit to imnotjames/typeorm that referenced this issue Sep 30, 2020
Because of a breaking feature in Typescript 3.7.0 we cannot upgrade
past that without marooning users of Typescript 3.5 / 3.6 & 4.0+

this locks typescript to ~3.6.0 explicitly

fixes typeorm#6809
fixes typeorm#6805
imnotjames added a commit to imnotjames/typeorm that referenced this issue Sep 30, 2020
Because of a breaking feature in Typescript 3.7.0 we cannot upgrade
past that without marooning users of Typescript 3.5 / 3.6 & 4.0+

this locks typescript to ~3.6.0 explicitly and fixes some small
issues that arise in using that version

fixes typeorm#6809
fixes typeorm#6805
pleerock pushed a commit that referenced this issue Sep 30, 2020
Because of a breaking feature in Typescript 3.7.0 we cannot upgrade
past that without marooning users of Typescript 3.5 / 3.6 & 4.0+

this locks typescript to ~3.6.0 explicitly and fixes some small
issues that arise in using that version

fixes #6809
fixes #6805
@imnotjames
Copy link
Contributor

This should be fixed as of 0.2.28

@Cristiandi
Copy link

@imnotjames everything working for me with 0.2.28 TY!

@anhpt97
Copy link

anhpt97 commented Oct 1, 2020

@imnotjames Thank you so much, bro! :)

@ahrasel
Copy link

ahrasel commented Oct 1, 2020

after update dependency typeorm to v0.2.28. it's work for me

zaro pushed a commit to zaro/typeorm that referenced this issue Jan 12, 2021
Because of a breaking feature in Typescript 3.7.0 we cannot upgrade
past that without marooning users of Typescript 3.5 / 3.6 & 4.0+

this locks typescript to ~3.6.0 explicitly and fixes some small
issues that arise in using that version

fixes typeorm#6809
fixes typeorm#6805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug regression worked in previous version and doesn't work in current
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants