Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] request-verifier-guard cant find TinkoffService in DI container #76

Open
talentumtuum opened this issue Feb 14, 2021 · 0 comments
Assignees

Comments

@talentumtuum
Copy link
Contributor

Описание бага

Не разрешаются зависимости RequestVerifierGuard пакета nestjs-tinkoff

Ожидаемое поведение

Зависимости разрешаются

Материалы

Nest could not find TinkoffService element (this provider does not exist in the current context)

  15 | 
  16 |   onModuleInit() {
> 17 |     this.ref.get(TinkoffService)
     |              ^
  18 |   }
  19 | }
  20 | 

  at InstanceLinksHost.get (../../node_modules/@nestjs/testing/node_modules/@nestjs/core/injector/instance-links-host.js:24:19)
  at Object.find (../../node_modules/@nestjs/testing/node_modules/@nestjs/core/injector/module-ref.js:38:55)
  at Object.get (../../node_modules/@nestjs/testing/node_modules/@nestjs/core/injector/module.js:339:28)
  at RequestVerifierGuard.onModuleInit (src/guards/request-verifier.guard.ts:17:14)
  at MapIterator.iteratee (../../node_modules/@nestjs/testing/node_modules/@nestjs/core/hooks/on-module-init.hook.js:22:43)
  at MapIterator.next (../../node_modules/iterare/src/map.ts:9:39)
  at IteratorWithOperators.next (../../node_modules/iterare/src/iterate.ts:19:28)
      at Function.from (<anonymous>)
  at IteratorWithOperators.toArray (../../node_modules/iterare/src/iterate.ts:227:22)
  at callOperator (../../node_modules/@nestjs/testing/node_modules/@nestjs/core/hooks/on-module-init.hook.js:23:10)

Что делать?

Нужно дать guard'е контекст нашего модуля
Похожая проблема решалась тут https://github.com/nestjs/passport/blob/master/lib/auth.guard.ts#L26

@TorinAsakura TorinAsakura transferred this issue from atls/nestjs Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant