aws-cdk-examples icon indicating copy to clipboard operation
aws-cdk-examples copied to clipboard

aws-cdk-examples/typescript/codepipeline-build-deploy: cdk synth fails (codeRepo undefined)

Open jaysonmc opened this issue 11 months ago • 2 comments

Describe the bug

Mark down instructions say to run cdk synth. However, the code for codeCommit (where codeRepo) was defined is commented out.

Note: I recall this was fixed and worked previously. Not sure if a previous commit undid code changes that introduced GitHub compatibility.

Expected Behavior

I expected cdk synth to not break.

Current Behavior

cdk synth errors out:

/mnt/c/Users/jaysosmc/Documents/Tech/TFC/BEX/samples/aws-cdk-examples/typescript/codepipeline-build-deploy/node_modules/ts-node/src/index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ⨯ Unable to compile TypeScript: lib/codepipeline-build-deploy-stack.ts:101:57 - error TS2304: Cannot find name 'codeRepo'.

101 source: codebuild.Source.codeCommit({ repository: codeRepo }), ~~~~~~~~ lib/codepipeline-build-deploy-stack.ts:120:57 - error TS2304: Cannot find name 'codeRepo'.

120 source: codebuild.Source.codeCommit({ repository: codeRepo }), ~~~~~

Reproduction Steps

Run cdk synth from aws-cdk-examples/typescript/codepipeline-build-deploy

Possible Solution

Either:

  1. Fix the code issue (undefined variable), or;
  2. Update the README on missing configuration to use a non-CodeCommit repository as source.

Additional Information/Context

No response

CDK CLI Version

2.1007.0

Framework Version

No response

Node.js Version

v18.20.8

OS

Linux YVR-1801553842 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Language

Typescript

Language Version

No response

jaysonmc avatar May 01 '25 14:05 jaysonmc

Hi, Can I handle this issue now?

marktech0813 avatar Nov 05 '25 08:11 marktech0813

The repo already defines codeRepo and wires it into CodeBuild and CodePipeline. A clean install/build followed by cdk synth works; errors likely from an older revision or commented code.

marktech0813 avatar Nov 05 '25 09:11 marktech0813