Is there a way to specify the network in a label without including the stack name?

In Traefik 2.x, we were able to use the unqualified network name in Traefik labels. With Traefik 3.x, I’m finding that doesn’t work and the stack name needs to be included in the label for Traefik to select the right IP.

Does anyone know a better way to do this? I don’t want to make my compose files depend on a particular stack name.

Traefik 2.x version:

services:
  echo:
    networks:
      - lb
      - private
    deploy:
      labels:
        - "traefik.docker.network=lb"

Traefik 3.x equivalent:

services:
  echo:
    networks:
      - lb
      - private
    deploy:
      labels:
        - "traefik.swarm.network=mystack_lb"

Are you sure it’s Traefik and not a new Swarm and compose setup? We usually name the networks (example), then you don’t have project prefix issues:

networks:
  proxy:
    name: proxy
    driver: overlay
    attachable: true