Closed tadejgasparovic closed 4 years ago
When calling EventStoreModule.registerFeatureAsync() , it injects NEST_EVENTSTORE_OPTION provider instead of NEST_EVENTSTORE_FEATURE_OPTION which ends up crashing Nest injector.
EventStoreModule.registerFeatureAsync()
NEST_EVENTSTORE_OPTION
NEST_EVENTSTORE_FEATURE_OPTION
The following shim works for me:
const _registerFeatureAsync = Reflect.get(EventStoreModule, 'registerFeatureAsync'); Reflect.set(EventStoreModule, 'registerFeatureAsync', function () { const module = _registerFeatureAsync.apply(null, arguments); module.imports[0].providers.find(p => ( p.provide === ProvidersConstants.EVENT_STORE_STREAM_CONFIG_PROVIDER )).inject = [NEST_EVENTSTORE_FEATURE_OPTION]; return module; });
@tadejgasparovic thanks for pointing out that bug, I will fix it and make a release. Thanks
When calling
EventStoreModule.registerFeatureAsync()
, it injectsNEST_EVENTSTORE_OPTION
provider instead ofNEST_EVENTSTORE_FEATURE_OPTION
which ends up crashing Nest injector.The following shim works for me: