Skip to content

Please verify whether the exported DbConnectionToken is available in this particular context. #503

@kartikradpretation

Description

@kartikradpretation

ERROR [ExceptionHandler] Nest cannot export a provider/module that is not a part of the currently processed module (TypegooseCoreModule). Please verify whether the exported DbConnectionToken is available in this particular context.

Possible Solutions:

  • Is DbConnectionToken part of the relevant providers/imports within TypegooseCoreModule?
    app.module.ts: import { Module } from '@nestjs/common';
    import { ConfigModule } from '@nestjs/config';
    import { TypegooseModule } from 'nestjs-typegoose';
    import { AppController } from './app.controller';
    import { AppService } from './app.service';
    import { AuthModule } from './modules/authentication/AuthModule';
    import configuration from './config/configuration';
    import { UserModule } from './modules/user/user.module';
    import { TypegooseCoreModule } from './typegoose-core/typegoose-core.module';
    import { MongooseModule } from '@nestjs/mongoose';

@module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
load: [configuration],
}),
UserModule,
TypegooseModule.forRoot("mongodb://localhost:27017/dbname", {
useNewUrlParser: true,
}),

],
controllers: [AppController],
providers: [AppService], // Remove ConfigModule from providers
})
export class AppModule {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions