When using Eureka as a server and client at the same time and setting eureka.client.refresh.enable=false, I get an error message related to cyclic dependency.

Error log:

The dependencies of some of the beans in the application context form a cycle:

┌─────┐
|  org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration (field private com.netflix.appinfo.ApplicationInfoManager org.springframework.cloud.netflix.eureka.server.EurekaServerAutoConfiguration.applicationInfoManager)
↑     ↓
|  org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$EurekaClientConfiguration (field private com.netflix.discovery.AbstractDiscoveryClientOptionalArgs org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$EurekaClientConfiguration.optionalArgs)
└─────┘

build.gradle: implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:4.2.0'

application.yml:

eureka:
  instance:
    hostname: ${HOSTNAME:localhost}
    instance-id: ${INSTANCE_ID:${random.uuid}}
  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
      defaultZone: ${CONFIG_SERVERS:http://${eureka.instance.hostname}:${server.port}/eureka/}
    refresh:
      enable: false