'services.kafka must be a mapping on Windows - not on Mac

When I run the following docker-compose file, I get "services.kafka must be a mapping". I'm getting this on Windows, but when I run the same file on Mac, I don't have an issue. Is there some setting I need to implement to get this to work?

I'm on Docker Desktop version 4.4 on Windows 10. Docker Engine is 20.10.14.

I've run the same docker-compose on another Windows machine and it works fine, so it seems like it's something with this specific laptop that's causing the problem.

Here's the docker compose (I know the formatting looks off here, but it's just because of the SO formatting):

version: '3.4'
services:



zookeeper:
    image: 'confluentinc/cp-zookeeper:5.2.4'
    ports:
      - 2181:2181
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      
  kafka:
    image: 'confluentinc/cp-kafka:5.2.4'
    ports:
      - 9092:9092
    depends_on:
      - zookeeper
    environment:
      KAFKA_LISTENERS: 'LC://kafka:29092,LX://kafka:9092'
      KAFKA_ADVERTISED_LISTENERS: 'LC://kafka:29092,LX://${DOCKER_HOST_IP:-localhost}:9092'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'LC:PLAINTEXT,LX:PLAINTEXT'
      KAFKA_INTER_BROKER_LISTENER_NAME: LC
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source