Open VermilionB opened 1 year ago
Hi @VermilionB
Check if main the module is connected, add the NestjsFormDataModule
to your BeatsModule
in imports
section.
Details in doc:
I've got same error when I use NestjsFormDataModule.configAsync(). The NestjsFormDataModule.config() is ok. This is my AppModule:
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
envFilePath: `.env.${process.env.NODE_ENV}`,
}),
MongooseModule.forRootAsync({
inject: [ConfigService],
useFactory: (config: ConfigService) => ({
uri: config.get<string>('DB_URL'),
}),
}),
// this is ok
// NestjsFormDataModule.config({
// isGlobal: true,
// storage: FileSystemStoredFile,
// fileSystemStoragePath: '/tmp/nest-starter',
// }),
// configAsync cause errors
NestjsFormDataModule.configAsync({
inject: [ConfigService],
useFactory: (config: ConfigService) => ({
isGlobal: true,
storage: FileSystemStoredFile,
fileSystemStoragePath: config.get<string>('TEMP_DIR'),
}),
}),
UsersModule,
AuthModule,
],
controllers: [],
providers: [
{
provide: APP_PIPE,
useValue: new ValidationPipe({ transform: true }),
},
],
})
export class AppModule {}
Error: Nest can't resolve dependencies of the FormDataInterceptor (?). Please make sure that the argument Symbol(Inject token for NestJsFormData global configuration object) at index [0] is available in the UsersModule context.
Hi @VermilionB Check if main the module is connected, add the
NestjsFormDataModule
to yourBeatsModule
inimports
section. Details in doc:
Docs says it needs to be imported on the app level while in reality it's not global by default and needs to be imported on module basis.
@wershest is correct, and i also solve the issue by using config instead of configAsync
I tryed to use your library, but got an error: Error: Nest can't resolve dependencies of the FormDataInterceptor (?). Please make sure that the argument Symbol(Inject token for NestJsFormData global configuration object) at index [0] is available in the BeatsModule context.
Here is my BeatsModule: