typeorm: Cannot set property EntityManager of #
Issue type:
[x] bug report
Database system/driver:
[x] postgres
TypeORM version:
[x] latest
Steps to reproduce or a small repository showing the problem:
TypeError: Cannot set property EntityManager of #<Object> which has only a getter
at Object.<anonymous> (/usr/src/app/node_modules/typeorm/index.js:120:23)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Module.require (internal/modules/cjs/loader.js:1074:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/usr/src/app/lib/index.js:5:19)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
Somehow getting this random error now and have. Literally tried rolling back my code and everything. Any suggestions where to look?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 112
- Comments: 40 (1 by maintainers)
Commits related to this issue
- tslib workaround for TypeORM https://github.com/typeorm/typeorm/issues/6054 — committed to lacuna-tech/mds-core by deleted user 4 years ago
- Workaround for https://github.com/typeorm/typeorm/issues/6054 — committed to harjis/graphs-folders-microservice by harjis 4 years ago
Edit your package.json at your project root directory to avoid using latest version of tslib
Temporary workaround:
npm i tslib@1.11.2 --saveand remove^before the version inpackage.json:tslibupdated which is exposing a pre-existing issue with double-exporting symbols:TSLib behavior change and other folks having problems with it have been reported there:
@possible819 you’ve saved my time.
Still diagnosing but in case this helps someone, it appears that even locking to
tslib@1.11.2, a cleanyarninstall will still manifest this error. However a cleannpminstall will allow my app to run fine. Very odd.I have the same problem. This is fantastic!
Okay, I fixed it and with yarn!!! After adding
tslib@1.11.2, I checked the version and the syntax to be correct in thepackage.jsonfile. Then, as it is stated above I also added, at the end of thepackage.jsonfile, this:Important: If you install
tslib@1.11.2with npm, make sure to remove thepackage-lock.jsonfile. For some reason, it also asked my to re-installreflect-metadata.Finally, I fixed it and everything works correctly right now! Thank you for the support guys.
Nada amigo, por el momento esa es la unica solución que he podido encontrar.
Lo que hice fue regresar mi versión de typeorm a la version 0.2.4. El problema se fue enseguida.