Variable file() fails with absolute path · Issue #3629 · serverless/serverless · GitHub
Skip to content

Variable file() fails with absolute path #3629

Description

@damonmaria

This is a Bug Report

Description

What went wrong?

Could not load file() when path given was absolute

What did you expect should have happened?

file() should handle absolute paths

What was the config you used?

...
provider:
  environment: ${file(/Users/damon/development/mindhive/graymont-trucks/deploy/build/dev/cloud/env-local.json)}

What stacktrace or error message from your provider did you see?

 Serverless Warning --------------------------------------
 
     A valid file to satisfy the declaration 'file(/Users/damon/development/mindhive/graymont-trucks/deploy/build/dev/cloud/env-local.json)'
     could not be found.

Additional Data

Just to show the file from the example above should work, it does exist:

$ ll /Users/damon/development/mindhive/graymont-trucks/deploy/build/dev/cloud/env-local.json
-rw-r--r--  1 damon  staff  560 16 May 20:52 /Users/damon/development/mindhive/graymont-trucks/deploy/build/dev/cloud/env-local.json

And if I change the path in serverless.yaml to be relative it works:

...
provider:
  environment: ${file(../deploy/build/dev/cloud/env-local.json)}
  • Serverless Framework Version you're using:
  • Operating System:
  Your Environment Information -----------------------------
     OS:                 darwin
     Node Version:       7.10.0
     Serverless Version: 1.13.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions