dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

[object Object] as environment variable when using CF functions #1713

Open 10Bude10 opened 1 year ago

10Bude10 commented 1 year ago

Bug Report

After updating severless (2.72.x -> 3.33.0) and serverless-offline (9.x -> 12.04) to the latest version my existing CF function doesn't work anymore. I will get [object Object] instead of an expected string[]. Beside my main yml-file I have for each stage another yml-file. Including allowed audiences: serverless.offline.yml

audiences:
    - 'A'
    - 'B'

This will be used in the main yml-file: serverless.yml

environment:
    OIDC_AUDIENCES:
      Fn::Join:
        - ','
        - ${file(./serverless.${self:provider.stage}.yml):oidc.audiences}

This works fine for online stages. Before updating it worked for offline as well. After updating I have to change to: serverless.yml

environment:
    OIDC_AUDIENCES: ${file(./serverless.${self:provider.stage}.yml):oidc.audiences}

But this won't work in online stages.

I want to use CF function even in offline mode, like it was possible in the past.

plugins:

provider: runtime: nodejs16.x stage: offline and dev

NickKelly1 commented 11 months ago

yep.... same