Closed NileshPatel17 closed 2 years ago
I think, I am not using it correctly.
This solved it. forRootAync solved it.
NotificationsModule.ts
TwilioModule.forRootAsync({
useFactory: async () => ({
accountSid: process.env.TWILIO_ACCOUNT_SID,
authToken: process.env.TWILIO_AUTH_TOKEN,
}),
}),
@NileshPatel17 Considering you're using @nestjs/config
I'd advise you to take a look at the forRootAsync
implementation in the docs, you can better utilize the use of ConfigModule
in that particular case. Anyway I'll be taking a look at the synchronous implementation in the next few weeks
@rejvban with forRootASync
, it did work. but i wonder if it should work with forRoot as well.
and, it has nothing to do with @nestjs/config
.
TwilioModule.forRootAsync({
useFactory: async () => ({
accountSid: process.env.TWILIO_ACCOUNT_SID,
authToken: process.env.TWILIO_AUTH_TOKEN,
}),
}),
please let me know your view.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bug Report
AppModule.ts
NotificationsModule.ts
Expected Behavior
i am still new to nestjs but i think, it should work with feature module. It works with root module(Appmodule.ts)
Error
When i import it to app.module, it works but when i import it to Notifications.module, it does not work.
I get below error when i import it to NotificationsModule.ts
Your Environment