My server doesn't get started because of Elascticsearch error: "Cannot read properties of undefined (reading 'cloud')". Anyone knows the solution? Cause i've already tried everything.
search.module.ts
@Module({
imports: [
ConfigModule,
ElasticsearchModule.registerAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => ({
node: configService.get('ELASTICSEARCH_NODE'),
auth: {
username: configService.get('ELASTICSEARCH_USERNAME'),
password: configService.get('ELASTICSEARCH_PASSWORD'),
}
}),
inject: [ConfigService],
}),
],
exports: [ElasticsearchModule]
})
export class SearchModule {}
docker-compose.yml
elastic:
container_name: elastic
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
environment:
- cluster.name=es-docker-cluster
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- elasticdata:/usr/share/elasticsearch/data
ports:
- "127.0.0.1:9200:9200"
networks:
- elastic
env_file: ".env"