Compose failed: Configuration file not found in directory

I’m stuck trying to impement serverless compose because I cannot even make it print the stack.

My structure is:
/
– src/api
---- serverless-base.yml
---- serverless-users.yml

serverless-compose.yml at the root of the project:

services:
  rest-api-base:
    path: src/api/serverless-base.yml
  rest-api-users:
    path: src/api/serverless-users.yml
    dependsOn: rest-api-base

serverless-base.yml contains a bunch of lambda functions and it’s too large.
The most important part of it is:

service: rest-api-base

package:
  individually: true

build:
  esbuild:
    configFile: ./esbuild.config.js
    bundle: true
    minify: true
    sourcemap:
      type: linked
      setNodeOptions: true

provider:
  name: aws
  runtime: nodejs20.x
  stage: ${opt:stage, 'dev'}
  region: ${opt:region, 'us-west-2'}
  stackName: rest-api-base-stack-${self:provider.stage}
  role: arn:aws:iam::652406230699:role/rest-api-lambda-role
  vpc:
    securityGroupIds:
      - sg-578a692b
    subnetIds:
      - subnet-014b53ba0bc3e05f4
      - subnet-0bffc145a19c5e60a
  environment: ${file(./serverless-environment.yml)}
  endpointType: regional
  timeout: 30
  memorySize: 256
  logs:
    restApi:
      accessLogging: false
      executionLogging: true
      level: ERROR
      fullExecutionData: false
      role: arn:aws:iam::652406230699:role/cloudwatch-access
      roleManagedExternally: true

When running sls print I get this output:

✖ Serverless Compose failed to run "print" on "rest-api-base"

✖ Configuration file not found in directory "/Users/demian/www/secret-project/src/api/serverless-base.yml"

Serverless Compose Run Report:
Command:
- print
Skipped:
- rest-api-users
Failed:
- rest-api-base

I cannot make sense of it. Which configuration file is not found?

Thanks.

@demian85 I would recommend adding this as an issue on the Serverless Framework GitHub. There was recently some work done around Compose. If it was something that always used to work but stopped since a recent update you may want to let the team know: Issues · serverless/serverless · GitHub

Looking at the docs, it looks as if the path property points to a directory containing a serverless.yml, no a path to a file that is not serverless.yml. You may just need to move the different serverless.yml configurations to different folders: Composing Services - Composing Serverless Framework Services