-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
This is a Bug Report
It is possible to define a project that never resolves variable population.
Description
-
What went wrong?
I attempted to package a project. SLS loaded and then hung indefinitely. -
What did you expect should have happened?
I expected a package to be produced -
What was the config you used?
Simple config:
serverless.yml:
service: test
provider:
name: aws
custom:
project: ${file(./project.yml)}
project.yml:
foo: baz
bar:
name: ${self:custom.project.foo}
- What stacktrace or error message from your provider did you see?
none is given
Additional Data
I've instrumented the code and produced the following list of unresolved variable resolutions:
unsettled promises:
file(./project.yml) waited on by:
${file(./project.yml)}
${file(./project.yml)}
self:custom.project.foo waited on by:
${self:custom.project.foo}
The problem is that resolving ${file(./project.yml)} involves, prior to replacing the custom.project attribute on the service object, attempting to resolve ${self:custom.project.foo} which then circularly attempts to resolve ${file(./project.yml)} again, resulting in a deadlock since ${file(./project.yml)} now cannot resolve until ${file(./project.yml)} is resolved.
It could have been any asynchronously resolving variable that referred to itself prior to being replaced in the origin object.
- Serverless Framework Version you're using: 1.25.0 / master
- Operating System: osx
- Stack Trace: n/a
- Provider Error messages: n/a