Step Functions: "State cannot be reached error" when it can be
See original GitHub issueDescribe the bug
I have a Step Function defined in ASL that includes a state used as a catcher for a different Map type state. When this state machine/SAM template is deployed, that state does not raise any errors, and correctly appears in the diagram as one of the output paths of the Map state.

If I pull this ASL definition into it’s own file to get checked my AWS Toolkit, the Tasks Map Catcher state triggers an error:
The state cannot be reached. It must be referenced by at least one other state.
{
	"resource": "/Users/farski/Repositories/Porter/state-machine.asl.json",
	"owner": "_generated_diagnostic_collection_name_#5",
	"severity": 8,
	"message": "The state cannot be reached. It must be referenced by at least one other state.",
	"startLineNumber": 694,
	"startColumn": 5,
	"endLineNumber": 694,
	"endColumn": 24
}
There seems to be a discrepancy between the way AWS Toolkit is checking for state reachability and the way Step Functions itself is resolving possible transitions.
To Reproduce
Save the ASL from this template to its own file and have it checked by AWS Toolkit. Compare the result with a deploy of that template.
Expected behavior
No error.
Desktop:
- OS: macOS 10.15.4
 - Visual Studio Code Version: 1.45.1
 - AWS Toolkit Version: 1.10
 
Issue Analytics
- State:
 - Created 3 years ago
 - Reactions:1
 - Comments:7 (4 by maintainers)
 

Top Related StackOverflow Question
I confirm the issue. This is a problem within amazon-states-language-service. Map state does not validate the “Next” property within “Catch” block of “Map” state. Catch block within “Task” and “Parallel” state do work as expected. https://github.com/aws/amazon-states-language-service/issues/25
I will update the AWS Toolkit to the new version of ASLS and it will be available with the next release. Usually, merged/released updates to the ASLS npm package will be available with the next release of the AWS Toolkit.