nestjs / typeorm

TypeORM module for Nest framework (node.js) 🍇
https://nestjs.com
MIT License
1.93k stars 206 forks source link

@InjectRepository throw error when i run jest tests #316

Closed wm4tos closed 4 years ago

wm4tos commented 4 years ago

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

@InjectRepository from @nestjs/typeorm throw this error : image when I run npm run test.

Expected behavior

In the file node_modules/@nestjs/typeorm/dist/common/typeorm.utils.js:16:26 the variable typeorm_1.Repository should be of class/object/function type.

Minimal reproduction of the problem with instructions

Here is the repo. You just need run npm install && npm run test to see error.

What is the motivation / use case for changing the behavior?

Environment


Nest version:
    "@nestjs/common": "^6.11.7",
    "@nestjs/core": "^6.11.7",
    "@nestjs/jwt": "^6.1.1",
    "@nestjs/mongoose": "^6.3.1",
    "@nestjs/passport": "^6.1.1",
    "@nestjs/platform-express": "^6.11.7",
    "@nestjs/swagger": "^4.2.8",
    "@nestjs/typeorm": "^6.3.1",


For Tooling issues:
- Node version: 12.14.1  
- Platform:  Linux 

Others:

chungchi300 commented 4 years ago

agree. same problem

kamilmysliwiec commented 4 years ago

See this response https://github.com/nestjs/typeorm/issues/321#issuecomment-589660186