-
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
TypeScript 4.7 Upgrade results in "Type instantiation is excessively deep and possibly infinite." #2277
Comments
Note: This might well be specific to the fact TypeScript 4.7 being a release candidate and still having some bugs, but I wonder if somebody more versed in TypeScript complex type inference could tell if that were the case. |
@laurisvan Did you manage to solve this? |
My PR #2278 seems to solve the issue. |
Any updates? |
Been running into this same issue as well. Specifically when using |
any update or any news here? |
Running into this issue as well. Anyone have a solution? |
Same thing happens with typescript 4.7.x. |
unfortunately, no change in my case in typescript 4.8.3, still getting same amount of |
I'm also encountering this issue with latest typescript 4.9.5 and objection 2.2.18. Occurs in a query using both Specifically, my query looks like this where this.Model.query()
.patch({ updatedBy })
.returning('*')
.where('id', id)
.first() |
Could somebody provide a reproducible example similar to the one provided in #2132 (comment) I have tried to reproduce this issue but have failed. This may be working now due to the change in 2cefc77 If somebody could test and confirm, or provide an example if the problem remains, that would be great, thanks! |
Hi @lehni, I am still experiencing this issue with the latest versions, i.e. |
@ahilke I wasn't talking of the latest released version. I have since merged some TS fixes and am curious to see if they help with this. Could you install objection from master in your repo and test? e.g. following https://www.pluralsight.com/guides/install-npm-packages-from-gitgithub |
Alright, thanks for the heads up! I'd say let's merge this and be done with it :) |
For the record, I was getting issues with this when downgrading a version of knex to match my objection version after realizing i had version conflicts (a PSA to always use NPM or non legacy yarn to avoid that) The source of the error was not because of a typescript nor an objection/knex versions issue per say. The error message is obtuse but it did surround a genuine type error in my calls to things like Before
After
|
This is a followup to issue #1668, which seems to resurface with the latest TypeScript (4.7 RC1) upgrade.
Queries of type
Result in TS error
TS2589: Type instantiation is excessively deep and possibly infinite.
.It appears it is related to this.$query() type of queries, and particularly to
.returning('*')
. The model class used in the app is of typeexport class WorkPlan extends RescommsModel
(where RescommsModel is of typeexport class RescommsModel extends Model
), but it appears that inheriting directly from Objection Model does not make any difference.The text was updated successfully, but these errors were encountered: