Middleware "chain-basic-auth@file" does not exist" in traefik higher than v2.2.7

This is the second deployment I try to do with traefik 2 using middlewares and I can't use a version higher than v2.2.7 because the middleware chain doesn't work and I constantly get the error:

"middleware "chain-basic-auth@file" does not exist" error.

when it really does exist and has no type, did something changed in that version forward with the middleware files?

This my middlewares.yml

http:
  middlewares:
    middlewares-basic-auth:
      basicAuth:
        realm: Traefik2 Basic Auth
        usersFile: /shared/.htpasswd
    middlewares-rate-limit:
      rateLimit:
        average: 100
        burst: 50
    middlewares-secure-headers:
      headers:
        accessControlAllowMethods:
          - GET
          - OPTIONS
          - PUT
        accessControlMaxAge: 100
        hostsProxyHeaders:
          - X-Forwarded-Host
        sslRedirect: true
        stsSeconds: 63072000
        stsIncludeSubdomains: true
        stsPreload: true
        forceSTSHeader: true
        customFrameOptionsValue: 'allow-from https:example.com'
        contentTypeNosniff: true
        browserXssFilter: true
        referrerPolicy: same-origin
        featurePolicy: >-
          camera 'none'; geolocation 'none'; microphone 'none'; payment 'none';
          usb 'none'; vr 'none';
        customResponseHeaders:
          X-Robots-Tag:

and this is my middlewares-chain.yml

http:
  middlewares:
    chain-no-auth:
      chain:
        middlewares:
          - middlewares-rate-limit
          - middlewares-secure-headers
    chain-basic-auth:
      chain:
        middlewares:
          - middlewares-rate-limit
          - middlewares-secure-headers
          - middlewares-basic-auth

from my docker-compose I call the chain file like this:

 labels:
      - "traefik.enable=true"
      - "traefik.http.routers.enjoty_api_flower.rule=Host(`www.example.com`)"
      - "traefik.http.routers.enjoty_api_flower.entrypoints=websecure"
      - "traefik.http.routers.enjoty_api_flower.tls.certresolver=myresolver"
      - "traefik.http.routers.enjoty_api_flower.middlewares=chain-basic-auth@file"

It works perfectly in traefik v2.2.7, but any traefik higher than that version keep me thoughing this annoying error:

"middleware "chain-basic-auth@file" does not exist" error.

Thanks in advance