nestjs / typeorm

TypeORM module for Nest framework (node.js) 🍇

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Created custom repository instance is undefined when calling functions

y-chen opened this issue · comments

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

Created instance of typeorm custom repository with NestFactory is undefined when using common functions (find, findOne, etc)

Expected behavior

Can use created custom repository

Minimal reproduction of the problem with instructions

https://github.com/y-chen/nestjs-typeorm-undefined-issue

npm i
npm run typeorm:run
npm run test

Environment

Nest version: 8.0.0
typeorm: 0.2.37

For Tooling issues:

  • Node version: v14.16.1
  • Platform: Mac

image
https://docs.nestjs.com/techniques/database#custom-repository

Please search through some of our old issues on this (this has been discussed tons of times in the past).