daypaio / nestjs-eventstore

Eventstore connector for nestjs
MIT License
54 stars 21 forks source link

Weird startup error #24

Open boenrobot opened 4 years ago

boenrobot commented 4 years ago

When starting up, I get the following in my logs:

[Nest] 13816   - 26.11.2019 г., 16:53:04 ч.   [InstanceLoader] EventStoreModule dependencies initialized
[Nest] 13816   - 26.11.2019 г., 16:53:04 ч.   [EventStoreBus] Catching up and subscribing to stream $ce-CasinoEngine!
[Nest] 13816   - 26.11.2019 г., 16:53:04 ч.   [EventStoreBus] Cannot read property 'subscribeToStreamFrom' of undefined +3ms
[Nest] 13816   - 26.11.2019 г., 16:53:04 ч.   [EventStoreBus]
      Connecting to persistent subscription App on stream $ce-App!

[Nest] 13816   - 26.11.2019 г., 16:53:04 ч.   [EventStoreBus] Cannot read property 'connectToPersistentSubscription' of undefined +1ms

my module init:

EventStoreCqrsModule.forRootAsync(
      {
        useFactory: () => ({
          endpoint: {
            host: '127.0.0.1',
            port: 1113,
          },
          settings: {
            defaultUserCredentials: {
              username: 'admin',
              password: 'changeit',
            },
          },
        }),
        inject: [],
      },
      {
        subscriptions: [
          {
            type: EventStoreSubscriptionType.Persistent,
            persistentSubscriptionName: 'App',
            stream: '$ce-App',
          },
          {
            type: EventStoreSubscriptionType.CatchUp,
            stream: '$ce-App',
          },
        ],
        eventInstantiators: {},
      },
    )

I'm new to EventStore, so I thought maybe I'm defining the subscription wrong... That doesn't seem to be the case... But either way, this log message is not helpful at all.

NTurchi commented 4 years ago

Hi,

This error comes from a malformed event-store connection setting object

Try to replace

settings: { 
    // [...]

by

connectionSettings: {
    // [...]

This issue is a bit outdated but it could help anyone who encounters the same issue.