-
Notifications
You must be signed in to change notification settings - Fork 45
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
Nest could not find TestLoader element (this provider does not exist in the current context) #39
Comments
The same is true for me. One dataloader is good,but two will not work。
The same is true for me. One dataloader is good,but two will not work。 |
If this is used twice, the error will be reported.This is the mistake: |
Sorry for taking so long to get back. But for starters, you should only place the interceptor in one module. After doing that, if that module is not the global module, import that module to the global module. Let me know if that makes sense, and we can keep troubleshooting from there |
@liangwei0101, that's by design. We don't want to instances of this class, as that would defeat the purpose of one thing loading everything at once. That's why we create a single instance in a single module, and then share that module |
It means that all implementations of dataloader should be placed in one place? For example:
That's what it means? |
That dataloaderinterceptor should be in a single module, generally the global, or in a module for the resolvers. You can then have your specific dataloader classes wherever they need in other modules |
This is how I have it setup And then I have my dataloaders in their specific domain modules, and export them.
Sorry about formatting, I'm on mobile. |
I see. Thank you |
Just added |
What about this error? I'm not asking for a fix. But, do you know what means?
I followed the steps, one by one. I tryed to put the interceptor inside local module and app.module.
The error show up only when I implement 2 dataloaders. It works nice with one dataloader.
Nest version: ^7.4.2
The text was updated successfully, but these errors were encountered: