#:question: General Issue
I tried to deploy a stack that had the following code:
export class WildcardSubdomainsStack extends cdk.Stack {
private readonly domain: string;
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const domain = `picture.bahr.dev`;
// this.domain is undefined
const hostedZone = HostedZone.fromLookup(this, 'HostedZone', { domainName: this.domain });
}
}
I had an error there, as I should have accessed the local variable, and not the construct variable domain.
It took me however quite long to find this issue, because the error message didn't give me much information.
Cannot read property 'endsWith' of undefined
Subprocess exited with error 1
Error: Subprocess exited with error 1
at ChildProcess.<anonymous> (/Users/michaelbahr/Documents/dev/wildcard-subdomains/node_modules/aws-cdk/lib/api/cxapp/exec.ts:118:23)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:485:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Figuring out this problem through the source code is not possible, as the mapping files for exec.ts don't seem to contain any endsWith.
The Question
Could you add some sanity checks that lead to a more descriptive error message?
Environment
- CDK CLI Version: 1.60.0 (build 8e3f53a)
- Module Version: 1.60
- Node.js Version: v13.14.0
- OS: OSX Mojave
- Language (Version): "typescript": "~3.7.2"
#:question: General Issue
I tried to deploy a stack that had the following code:
I had an error there, as I should have accessed the local variable, and not the construct variable
domain.It took me however quite long to find this issue, because the error message didn't give me much information.
Figuring out this problem through the source code is not possible, as the mapping files for
exec.tsdon't seem to contain anyendsWith.The Question
Could you add some sanity checks that lead to a more descriptive error message?
Environment