Closed ecorona closed 4 years ago
Update:
this only happens when using:
PDFModule.registerAsync({
useFactory: (): PDFModuleOptions => ({
view: {
root: './templates',
engine: 'ejs',
},
}),
}),
It works fine when using:
PDFModule.register({
view: {
root: './templates',
engine: 'ejs',
},
}),
Hi @ecorona, apologies for the late response. This bug has been fixed by #5 . Please update to version 1.0.4 of the package.
Hi, I am using the latest version "^1.0.4", and I'm getting the same error describe above:
NestWinston] Error 2020-11-12 12:28:34 [ExceptionHandler] Nest can't resolve dependencies of the PdfService (?). Please make sure that the argument PdfToken(a) at index [0] is available in the MyAppModule context.
Potential solutions:
- If PdfToken(a) is a provider, is it part of the current MyAppModule?
- If PdfToken(a) is exported from a separate @Module, is that module imported within MyAppModule?
@Module({
imports: [ /* the Module containing PdfToken(a) */ ]
})
This happens with PDFModule.register and PDFModule.registerAsync
I set up in my AppModule (main module)
AppModule
...
PDFModule.register({
view: {
root: '/commons/template',
engine: 'pug',
},
}),
...
export class AppModule {
static port: number | string;
constructor(private readonly _configService: AppConfigService) {
AppModule.port = _configService.get(Configuration.PORT);
}
}
Then I use in my child module:
LiquidacionesModule
@Module({
imports: [
MongooseModule.forFeature([
{ name: Liquidacion.name, schema: LiquidacionSchema },
{ name: Hes.name, schema: HesSchema },
])
],
controllers: [LiquidacionesController],
providers: [LiquidacionesService, HesService, ReportService, PdfService, Logger],
exports: [LiquidacionesService]
})
export class LiquidacionesModule {}
When I move config from AppModule to LiquidacionesModule and it works, but I'd like it to be available for all modules, is it possible?
Hi there! im trying to implement your library by following your instructions but i'm getting this error:
Is there anything missing on the exports/imports side?
thank you