Import statement breaks typeorm enitities when registered through config.json file
- Make sure you have
"module": "commonjs"
in"compilerOptions"
oftsconfig.json
- Run typeorm cli using ts-node:
ts-node ./node_modules/typeorm/cli.js
See docs
Are you getting the error when trying to run the CLI, or when running the app?
You may need to change the "entities"
entry in ormconfig.json
to ["dist/entity/**/*.js"]
or the "entitiesDir"
to "dist/entity"
.