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

Sequelize typings break w/ TS 4.9 beta #15133

Closed
3 of 6 tasks
ethanresnick opened this issue Oct 15, 2022 · 3 comments
Closed
3 of 6 tasks

Sequelize typings break w/ TS 4.9 beta #15133

ethanresnick opened this issue Oct 15, 2022 · 3 comments
Assignees
Labels
type: bug type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.

Comments

@ethanresnick
Copy link

ethanresnick commented Oct 15, 2022

Issue Creation Checklist

  • I understand that my issue will be automatically closed if I don't fill in the requested information
  • I have read the contribution guidelines

Bug Description

Using TS 4.9's latest beta (4.9.0-dev.20221015) and Sequelize 6.25.1, models that use InferAttributes now produce a type error, whereas they work in earlier TS versions.

Reproducible Example

import sequelize, {  InferAttributes, InferCreationAttributes } from 'sequelize';

const { Model } = sequelize;

class TestModel extends Model<
  InferAttributes<TestModel>,
  InferCreationAttributes<TestModel>
> {
  public declare id: string;
}

What do you expect to happen?

Code should compile.

What is actually happening?

TS error, highlighting the expression:

error TS2589: Type instantiation is excessively deep and possibly infinite.

6   InferAttributes<TestModel>,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

Environment

  • Sequelize version: 6.25.1
  • TypeScript version: 4.9.0-dev.20221015
  • Node.js version: n/a
  • Database & Version: n/a
  • Connector library & Version: n/a

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I will need guidance.
  • No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
  • No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.

Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.

@ephys ephys added type: bug type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense. labels Oct 15, 2022
@ephys ephys self-assigned this Oct 15, 2022
@ephys
Copy link
Member

ephys commented Oct 15, 2022

Thanks for the heads up. #15134 & #15135 should fix this

@WikiRik
Copy link
Member

WikiRik commented Oct 16, 2022

Fixed in the latest releases

@WikiRik WikiRik closed this as completed Oct 16, 2022
@ethanresnick
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug type: typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.
Projects
None yet
Development

No branches or pull requests

3 participants