akveo / akveo/ngx-admin-bundle-support

NestJS Nest can't resolve dependencies of the UserService (?, SettingsService).

未关闭
#45 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
56
派生
30
PR 合并指标
30 天内没有已合并 PR

描述

When you start the APP this is the error you get, also testing with e2e will give the error too.

```
$ jest --config ./test/jest-e2e.json
FAIL test/app.e2e-spec.ts (10.787s)
AppController (e2e)
× / (GET) (252ms)

● AppController (e2e) › / (GET)

Nest can't resolve dependencies of the UserService (?, SettingsService). Please make sure that the argument UserModel at index [0] is available in the AuthModule context.

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

at Injector.lookupComponentInExports (../node_modules/@nestjs/core/injector/injector.js:185:19)
at Injector.resolveComponentInstance (../node_modules/@nestjs/core/injector/injector.js:142:33)
at resolveParam (../node_modules/@nestjs/core/injector/injector.js:96:38)
at async Promise.all (index 0)
at Injector.resolveConstructorParams (../node_modules/@nestjs/core/injector/injector.js:111:27)
at Injector.loadInstance (../node_modules/@nestjs/core/injector/injector.js:78:9)
at Injector.loadProvider (../node_modules/@nestjs/core/injector/injector.js:35:9)
at async Promise.all (index 6)
at InstanceLoader.createInstancesOfProviders (../node_modules/@nestjs/core/injector/instance-loader.js:41:9)
at ../node_modules/@nestjs/core/injector/instance-loader.js:27:13
at async Promise.all (index 3)
at InstanceLoader.createInstances (../node_modules/@nestjs/core/injector/instance-loader.js:26:9)
at InstanceLoader.createInstancesOfDependencies (../node_modules/@nestjs/core/injector/instance-loader.js:16:9)
at TestingModuleBuilder.compile (../node_modules/@nestjs/testing/testing-module.builder.js:38:9)

● AppController (e2e) › / (GET) TypeError: Cannot read property 'getHttpServer' of undefined 22 | 23 | it('/ (GET)', () => { > 24 | return request(app.getHttpServer()) | ^ 25 | .get('/') 26 | .expect(200) 27 | .expect('Hello World!'); at Object. (app.e2e-spec.ts:24:24)
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。