Issue with docker compose develop key on version 3.8

Hey why when I try to use develop key I get this error Key ‘develop’ is not expected here I used he latest version of docker compose

It depends on the compose plugin version not the version defined in the yaml which is completely ignored now.

the compose version that i use is 2.23 and it`s still not excepting the develop key

Please, share the compose file in a code block: How to format your forum posts

version: ‘3.8’

services:
frontend:
build:
context: .
dockerfile: Dockerfile
ports:
- ‘3000:3000’
env_file:
- .env
volumes:
- .:/app
- /app/node_modules
develop:
watch:
- path: ./package.json
action: rebuild
- path: ./next.config.js
action: rebuild
- path: ./package-lock.json
action: rebuild
- path: .
target: /app
action: sync

volumes:
task-organizer:

Then please, read my post again and edit yours according to the guide I linked. Thank you!

version: '3.8'

services:
  frontend:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - '3000:3000'
    env_file:
      - .env
    volumes:
      - .:/app
      - /app/node_modules
    develop:
      watch:
        - path: ./package.json
          action: rebuild
        - path: ./next.config.js
          action: rebuild
        - path: ./package-lock.json
          action: rebuild
        - path: .
          target: /app
          action: sync

volumes:
  task-organizer:

Thank you for sharing the formatted version. The file looks correct. Are you absolutely sure you are using compose 2.23? The compose plugin can be in multiple folders and it can happen that docker loads it from a folder where it finds an older version. What does the following command returns?

docker compose version

Also do you run the project by running docker compose up -d and not docker-compose up -d ?

yoad208@yoad-computer:/mnt/wsl/docker-desktop-bind-mounts/Ubuntu-20.04/7a8989e29607dc3b223495fecb4ac111f7ad09bd3d852ff9f3f18baf9b7a80a1$ docker compose version
Docker Compose version v2.23.3-desktop.2

yes also when I check it return me the version