madeindjs / nestjs-graphile-worker

A Nest.js wrapper for Graphile Worker
https://www.npmjs.com/package/nestjs-graphile-worker
MIT License
35 stars 13 forks source link

Dependency errors #9

Open MrTin opened 1 year ago

MrTin commented 1 year ago

Hey -- thanks for putting this library together!

Just dropped this into NestJS 9.0.4 project and using both forRoot and forRootAsync. Just curious if you've ever seen the following error or know what could be the issue?

Error: Nest can't resolve dependencies of the DiscoveryService (?). Please make sure that the argument ModulesContainer at index [0] is available in the DiscoveryModule context.

Potential solutions:
- If ModulesContainer is a provider, is it part of the current DiscoveryModule?
- If ModulesContainer is exported from a separate @Module, is that module imported within DiscoveryModule?
  @Module({
    imports: [ /* the Module containing ModulesContainer */ ]
  })

    at Injector.lookupComponentInParentModules (/Users/ms/projects/love/api/node_modules/@nestjs/core/injector/injector.js:241:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Injector.resolveComponentInstance (/Users/ms/projects/love/api/node_modules/@nestjs/core/injector/injector.js:194:33)
    at resolveParam (/Users/ms/projects/love/api/node_modules/@nestjs/core/injector/injector.js:116:38)
    at async Promise.all (index 0)
    at Injector.resolveConstructorParams (/Users/ms/projects/love/api/node_modules/@nestjs/core/injector/injector.js:131:27)
    at Injector.loadInstance (/Users/ms/projects/love/api/node_modules/@nestjs/core/injector/injector.js:57:13)
    at Injector.loadProvider (/Users/ms/projects/love/api/node_modules/@nestjs/core/injector/injector.js:84:9)
    at async Promise.all (index 4)
    at InstanceLoader.createInstancesOfProviders (/Users/ms/projects/love/api/node_modules/@nestjs/core/injector/instance-loader.js:47:9)
madeindjs commented 1 year ago

hey, I thought that https://github.com/madeindjs/nestjs-graphile-worker/pull/8 fixed it. Do you use v0.2.0?

NikoHadouken commented 1 year ago

I'm not sure if this is the same problem as in #8. I had conflicting peer dependencies when installing this package in a NestJS v9 app. The error from @MrTin looks like a runtime error when doing dependency injection.

This could be because of a mistake in your module setup. Can you provide an example repo?