-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Nest can't resolve dependencies of the FormDataInterceptor (?) #54
Comments
Hi @VermilionB |
I've got same error when I use NestjsFormDataModule.configAsync(). The NestjsFormDataModule.config() is ok. @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. |
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:
The text was updated successfully, but these errors were encountered: