I have a package inside a lerna project which has a dynamic module which contains a provider defined by a string. It's pretty much similar to the dynamic module described in nestjs docs.
import { DynamicModule, Module } from '@nestjs/common';
import { ConfigService } from './config.service';
@Module({})
export class ConfigModule {
static register(options: Record<string, any>): DynamicModule {
return {
module: ConfigModule,
providers: [
{
provide: 'CONFIG_OPTIONS',
useValue: options,
},
ConfigService,
],
exports: [ConfigService],
};
}
}
I'm facing a dependency issue when using generated package inside another repo because nest cannot resolve dependency for CONFIG_OPTIONS.
If I export the same JSON object that is in providers the issue disappears, but that change looks as a wrong way.
This is happening in nest 9.4.0, and it works in version 8(i'm migration from 8 to 9).
Can I get some guidance about the issue and accurate solution(s)? Thanks in advance.