Please see the code below, I've tried to debug this problem, but I was unsuccessful. Any help is much appreciated
Error stacktrace:
UnknownElementException [Error]: Nest could not find UsersService element (this provider does not exist in the current context)
at InstanceLinksHost.get (/Users/repos/api/node_modules/@nestjs/core/injector/instance-links-host.js:15:19)
at Object.find (/Users/repos/api/node_modules/@nestjs/core/injector/module-ref.js:39:55)
at Object.get (/Users/repos/api/node_modules/@nestjs/core/injector/module.js:350:28)
at UsersService.getArgument (/Users/repos/api/node_modules/nest-transact/dist/lib/with-transaction.js:31:35)
at /Users/repos/api/node_modules/nest-transact/dist/lib/with-transaction.js:83:43
at Array.forEach (<anonymous>)
at UsersService.findArgumentsForProvider (/Users/repos/api/node_modules/nest-transact/dist/lib/with-transaction.js:79:14)
at UsersService.getArgument (/Users/repos/api/node_modules/nest-transact/dist/lib/with-transaction.js:71:29)
at /Users/repos/api/node_modules/nest-transact/dist/lib/with-transaction.js:83:43
at Array.forEach (<anonymous>)
Controller code
@ApiTags('Users')
@Controller('users')
export class UsersController {
constructor(private readonly usersService: UsersService, private readonly dataSource: DataSource) {}
@Post('create-user')
@ApiOperation({
summary: 'Role: open. Creates: User, User.stripe, User.inventory for all itemTypes, User.address',
description: 'Creates user. For address please enter both types of address: bill_to and ship_to.',
})
@ApiBody({ type: CreateUserDto, required: true })
@ApiResponse({ type: Boolean, status: 201 })
async create(@Body() createUserDto: CreateUserDto): Promise<boolean> {
return await this.dataSource.transaction(manager => this.usersService.withTransaction(manager).create({ createUserDto }));
}
}
Hi @SocDean ! Is this problem still present? And is it really related to the nest-transact? What would you see if you will remove ... extends TransactionFor<UsersService>?
Description
Please see the code below, I've tried to debug this problem, but I was unsuccessful. Any help is much appreciated
Error stacktrace:
Controller code
Service code: