Skip to content

Export assignment cannot be used in /sequelize/lib/operators.ts #13803

Closed

Description

@peaverok

Issue Creation Checklist

[ X] I have read the contribution guidelines

Bug Description

I get the following error when I try to build my typescript project:
node_modules/sequelize/lib/operators.ts:524:1 - error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.

524 export = Op;

NOTE: This is in the new 6.12.1 release that is supposed to fix this problem.

What do you expect to happen?

My project builds successfully.

What is actually happening?

I get the following error when I try to build my typescript project:
node_modules/sequelize/lib/operators.ts:524:1 - error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.

Additional context

NOTE: This is in the new 6.12.1 release that is supposed to fix this problem.

Here is my tsconfig.json

{
"compileOnSave": false,
"compilerOptions": {
"rootDir": ".",
"baseUrl": "./",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"sourceMap": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"target": "ES2020",
"outDir": "./dist",
"typeRoots": ["node_modules/@types", "src/typings"],
"lib": ["ESNext"],
"types": ["node"]
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

My build is simply:
"build:prod": "set NODE_ENV=production&& tsc",

Environment

  • Sequelize version: 6.12.1
  • Node.js version: 16.13.1
  • If TypeScript related: TypeScript version: 4.4.4

Bug Report Checklist

How does this problem relate to dialects?

  • I think this problem happens regardless of the dialect.
  • [x ] I think this problem happens only for the following dialect(s):
  • I don't know, I was using PUT-YOUR-DIALECT-HERE, with connector library version XXX and database version XXX

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 don't know how to start, I would need guidance.
  • [x ] No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Activity

  1. ephys commented on Dec 21, 2021

    @ephys
    Member

    Same issue as #13791, I've reopened it, let's continue there :)

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