-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(cli): cdk watch does not recover if there is an error in cdk stack/app #27864
Description
Describe the bug
If I made an error that does not resolve into a valid cloudformation, cdk watch throws the error on console. However, if I fix that issue, I would expect cdk to detect the issue to resolve and deploy the correct cloudformation template. CDK watch gets hung instead.
Expected Behavior
Expect cdk watch to redeploy once the error has been fixed.
Current Behavior
If I made an error that does not resolve into a valid cloudformation, cdk watch throws the error on console. However, if I fix that issue, CDK watch gets hung. It detects the change but does not deploy.
Reproduction Steps
This is a valid stack and app :
app = App()
ApiEventBridgeLambdaStack(app, "ApiEventBridgeLambdaStack")
If I update it to the following while cdk watch is running, cdk watch will throw the error but stays hung after I fix the error (remove a mistyped N in this case):
app = App()
ApiEventBridgeLambdaStack(appN, "ApiEventBridgeLambdaStack")
This happens with stack level changes as well.
Detects change but does not deploy, stays in hung state :
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
v2.100.0
Framework Version
No response
Node.js Version
v18.16.0
OS
MAC
Language
Python
Language Version
3.10.6
Other information
Reproducible with typescript too
Workaround is to interrupt the terminal and re run cdk watch.
