sequelize-typescript icon indicating copy to clipboard operation
sequelize-typescript copied to clipboard

feature: nodenext support maybe have a break change for sequelize-typescript tsconfig.json

Open Beace opened this issue 3 years ago • 0 comments

Issue

Versions

  • sequelize: 6.21.2
  • sequelize-typescript: 2.1.3
  • typescript: 4.7.2

Issue type

  • [x] feature request related https://github.com/sequelize/sequelize/pull/14719

Actual behavior

my tsconfig.json

{
  "compilerOptions": {
    "module": "nodenext",
   "moduleResolution": "nodenext"
  }
}

tsc build throw errors

image

Expected behavior

support nodenext features.

Steps to reproduce

the sequelize(v6) package.json not exports types path.

 "exports": {
    ".": {
      "import": "./lib/index.mjs",
      "require": "./lib/index.js",
      "types": "./types/index.d.ts"
    },
    "./lib/*": {
      "default": "./lib/*.js",
      "types": "./types/*.d.ts"
    },
    "./lib/errors": {
      "default": "./lib/errors/index.js",
      "types": "./types/errors/index.d.ts"
    },
    "./package.json": "./package.json"
  },

So import { SequelizeHooks } from 'sequelize/types/hooks'; not working for ESM and import { SequelizeHooks } from 'sequelize/lib/hooks'; not working for commonjs.

Beace avatar Jul 10 '22 05:07 Beace