serverless-offline icon indicating copy to clipboard operation
serverless-offline copied to clipboard

[object Object] as environment variable when using CF functions

Open 10Bude10 opened this issue 1 year ago • 1 comments

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:

  • serverless-offline

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

10Bude10 avatar Jul 14 '23 09:07 10Bude10

yep.... same

NickKelly1 avatar Aug 19 '23 05:08 NickKelly1