Skip to content

TypeScript: The data type in the "sequelize/types/lib" folder is different from the data type in the "sequelize/dist/lib" folder #13811

Closed

Description

@luongtech

The data type in the "sequelize/types/lib" folder is different from the data type in the "sequelize/dist/lib" folder
This happened when I updated from 6.6.2 to version 6.12.2. The data type in the "Lib" folder is different from the data type in the "Types" folder.


Currently I am using:
NestJS: v7.6.15
NodeJS: v16.13.0


Config in file "tsconfig", I also turned off "strictFunctionTypes":

{
    "extends": "./tsconfig.paths.json",
    "compilerOptions": {
        "allowUnreachableCode": true,
        "alwaysStrict": true,
        "noFallthroughCasesInSwitch": true,
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "module": "commonjs",
        "declaration": false,
        "removeComments": true,
        "strictFunctionTypes": false,
        "resolveJsonModule": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "allowSyntheticDefaultImports": true,
        "target": "es2019",
        "sourceMap": false,
        "declarationMap": false,
        "outDir": "./dist",
        "baseUrl": "./",
        "incremental": true
    }
}

Please, Can someone help me with this?
Because, On version 6.12.2 have feature "ON DUPLICATE" when have index by field.

Activity

  1. luongtech commented on Dec 23, 2021

    @luongtech
    Author

    Oh! I fixed it.


    I fixed them, just replaced the whole "sequelize/types" to "sequelize"

    import { FindOptions, Op, WhereOptions and more...} from 'sequelize/types';
    // => import { FindOptions, Op, WhereOptions and more...} from 'sequelize'; 
  2. ephys commented on Dec 23, 2021

    @ephys
    Member

    Yes that's an issue that occurred during the TypeScript Migration. Sorry about that, it was an unforeseen breaking change :/
    You're right though: completely avoid importing from sequelize/types/* (or sequelize/lib). Only ever import from sequelize and things should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions