Closed macure closed 9 months ago
Thank you for taking the time to submit your report! From the looks of it, this could be better discussed on our Discord. If you haven't already, please join here and send a new post in the # 🐈 nestjs-help forum. Make sure to include a link to this issue, so you don't need to write it all again. We have a large community of helpful members, who will assist you in getting this to work.
Is there an existing issue for this?
Current behavior
I created a dynamic module, like it was explained in the documentation by using a ConfigurableModuleBuilder and ConfigurableModuleClass
I'm getting this error when trying to inject the configuration token into a pipe:
Nest can't resolve dependencies of the ProcessImagePipe (?). Please make sure that the argument CONFIGURABLE_MODULE_OPTIONS[02271392a116315423ae3] at index [0] is available in the AppModule context.
image.module-definitions.ts
image.module.ts
app.module.ts
app.controller.ts
That being said, I was perfectly fine injecting the same token in image.service.ts and it works without any errors. It's just when I try to inject it in the pipe.
What works here is if I inject ImageService, which already has MODULE_OPTIONS_TOKEN injected... All works... no errors.
Does any one now if this is a desired behavior? Why wouldn't we want to inject tokens in the Pipe directly?
Minimum reproduction code
https://stackblitz.com/edit/nestjs-typescript-starter-t3bgqu
Steps to reproduce
Just run (in case this hasn't been done for you already)
Then check the error log in the console
Expected behavior
I expected to have access to injected token inside a pipe.
In the context of the provided code: I expect to see the output of:
Package
Other package
No response
NestJS version
10.1.18
Packages versions
Node.js version
v18.18.0
In which operating systems have you tested?
Other
Tested on several different NestJS and Node versions with same result.
I hope you can shed some light ...
Thank you