Hi,
I am getting this error:
[ExceptionsHandler] Cannot read property 'getMany' of undefined +14494ms
TypeError: Cannot read property 'getMany' of undefined
at StockController.getManyBase (C:\git_wa\privat\myStocks\crud-test-reponode_modules\@nestjsx\crud\lib\crud\crud-routes.factory.js:115:33)
at C:\git_wa\privat\myStocks\crud-test-reponode_modules\@nestjs\core\router\router-execution-context.js:36:29
at process._tickCallback (internal/process/next_tick.js:68:7)
I got a pretty basic setup. Just one Feature Module which should use nestjsx/crud to setup all the routes.
Here is a example repo which reproduces the error:
https://github.com/MeMeMax/crud-test-repo
Does anyone have a idea why this happens?
Change stockService to service and it will work. Crud services must be provided in controllers as a property name called service
@zMotivat0r Thanks for your help. This should be documented as a Warning or a hint in the docs. Someone likes to have service names which reflect the service and might step into this pitfall.
@MeMeMax yeah, you're probably right. I'll be glad to see a PR from you, if you want :)
@zMotivat0r, are there any way to custom this name?
Most helpful comment
https://github.com/MeMeMax/crud-test-repo/blob/b83064c68d7625618b94518ecc05abaa2e12c232/src/stock/controllers/stock.controller.ts#L14
Change
stockServicetoserviceand it will work. Crud services must be provided in controllers as a property name calledservice