Skip to content

Conversation

@robertrossmann
Copy link
Member

fix #9

The problem was that wrapping the dataloader Factory into a Nest.js sub-module caused that module to not have access to the parent's providers, thus dependency injection did not work. To complement the problem, it looks like vitest uses esbuild under the hood which does not support emitting decorator metadata which in turn caused Nest.js to not be able to properly find the referenced providers (because it needs that metadata).

I changed the API for registering dataloader Factory (see the updated README) and adopted swc as the vitest compiler.

@robertrossmann robertrossmann added bug Something isn't working dependencies Pull requests that update a dependency file labels May 18, 2025
@robertrossmann robertrossmann self-assigned this May 18, 2025
@robertrossmann robertrossmann merged commit 4b15146 into master May 18, 2025
1 check passed
@robertrossmann robertrossmann deleted the fix/injection branch May 18, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependency injection into the Factory doesn't seem to work

2 participants