Is AWS CDK generating nested cdk.out directories during synthesis?

Whilst working on my AWS CDK project for educational purposes, I found myself immersed in learning TypeScript, node.js, npm, and all related concepts simultaneously. Despite the mishap that occurred, requiring me to restart from the Github repository rather than my local copy, everything seemed to be going smoothly.

After cloning the Github repository onto my computer, I proceeded to run npm install to install dependencies followed by cdk synth, which had been functioning perfectly just moments before the need to clone the repo.

To my surprise, the command now took an eternity to execute. Upon investigation, I discovered that it was generating recursive cdk.out directories like this:

https://i.sstatic.net/WOCyp.png

If anyone could shed some light on what might be causing this issue, I would greatly appreciate it :)

Answer №1

Success! It took a good 2 hours of digging, but I finally uncovered the culprit.

It turns out that the issue lies within the Lambda stack included in my application. The problematic line causing all the trouble is as follows:

code: lambda.Code.fromAsset(process.env.CODEBUILD_SRC_DIR_BuildLambda || "")

The problem arises because the environment variable is not defined on my local machine (yet it exists in the CodeBuild environment used for deploying my app). This causes it to default to an empty string "", which then triggers the lambda to include the entire CDK application itself and consequently leads to a recursive build.

Now, the challenge is to find a solution to this issue and figure out why it was working initially (possibly due to setting the CODEBUILD_SRC_DIR_BuildLambda variable locally).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Calculating the total of all values in a table

For my ngFor loop, the invoice total is calculated based on price and hours, but I also want to calculate the totals of all invoices in the end. <tr *ngFor="let invoice of invoiceItem.rows"> <td>{{ invoice.rowName }}</td> <td& ...

Is there a way to open an image.png file in typescript using the "rb" mode?

Is there a way to open png files in typescript similar to the python method with open(path+im,"rb") as f:? I have a folder with png files and I need to read and convert them to base 64. Can anyone assist me with the equivalent method in typescript? This i ...

Update not reflected in parent form when using ValueChanges in Angular's ControlValueAccessor

Here is the code snippet I am currently working with: https://stackblitz.com/edit/angular-control-value-accessor-form-submitted-val-egkreh?file=src/app/app.component.html I have set default values for the form fields, but when clicking the button, the pa ...

Retrieve the value of the Type Property dynamically during execution

Looking at this type generated from a graphql schema: export type UserPageEntry = { readonly __typename?: 'UserPageEntry' } I am interested in retrieving the string representation of its only property type ('UserPageEntry') during co ...

Create a new project using Firebase Functions along with a Node.js backend and a React.js frontend

In the process of developing my application, I have chosen to utilize node.js, express.js, and Firebase with firebase functions, all coded in TypeScript. For the client side framework, I am interested in incorporating react.js. Currently, I have set up nod ...

Ways to trigger the keyup function on a textbox for each dynamically generated form in Angular8

When dynamically generating a form, I bind the calculateBCT function to a textbox like this: <input matInput type="text" (keyup)="calculateBCT($event)" formControlName="avgBCT">, and display the result in another textbox ...

Upon executing the tsd install and tsd query commands, a message indicating 'no results found' was displayed

Whenever I run these commands in Git Bash on Windows tsd query angular-material tsd query angular tsd install angular angular-material I always receive the message ">> zero results" ...

Streamline the transition between various environments for Python projects by automating the process of managing dependencies

I have been tackling a variety of Python projects that rely on different versions of the same library. When I use pip to install libraries, they are installed globally as a single version. The only workaround I'm aware of to manage multiple versions o ...

Learn how to incorporate npm packages into nw.js without the need to install Node JS

I am looking to incorporate the node-ssh npm package into my nw.js application. I have successfully installed Node.js and the package on my development system, but I don't want to create a dependency on Node.js when shipping the application. Is it po ...

Execute a function when a button is pressed in a React application

Currently, I am dynamically generating some HTML and have a requirement for certain "events" to trigger an onclick function. The technology stack I am using for this project involves React and TypeScript. My initial approach is as follows: function add_ev ...

Ensure password confirmation is correct

Currently, I'm utilizing Yup for form validation. You can check it out here: https://www.npmjs.com/package/yup. Additionally, I came across this package called yup-password which seemed helpful for validating my Formik forms. Here's the link to i ...

Building Reusable Components in Angular 2: A Step-by-Step Guide

I have implemented a feature in my component where a table can be sorted by clicking on the <th></th> tags. When a user clicks on a th tag, the data is sorted either in ascending (ASC) or descending (DESC) order. In my component, I have set up ...

Tips on streamlining two similar TypeScript interfaces with distinct key names

Presented here are two different formats for the same interface: a JSON format with keys separated by low dash, and a JavaScript camelCase format: JSON format: interface MyJsonInterface { key_one: string; key_two: number; } interface MyInterface { ...

How can I receive updates when an interface changes in Angular?

I'm attempting to subscribe to my interface and monitor for any changes, but I keep encountering errors. Fetching data from the API and assigning it to this.candidateProfile : export interface CandidateProfile { about: string, c_id: {}, cer ...

The React project successfully compiled, but it is not displaying in the browser

I have completed several react projects in the past, but this is the first time I have run into this issue. After following the steps: npx create-react-app myapp cd myapp I successfully created the react project and ran: npm start Everything seemed to ...

The Angular service is sending back the error message "undefined" when trying to retrieve data with the ID parameter from the requested

When calling a service from a component, I am encountering a 400 bad request error with the following message: "Invalid data 'undefined' for parameter id" It's worth noting that the getProduct method in the API is functioning correctly. ...

Npm appears to be experiencing technical difficulties, even though it is displaying the version number

Node was successfully installed on my computer without any issue. However, every time I attempt to use npm, it consistently throws the same error. I have experimented with different node modules and packages, but the error persists. node -v v9.8.0 npm -v v ...

The error message states that the property 'registerUser' is not found on the class 'UserController'

In the controller file, I exported two functions (registerUser and loginUser) as default. No errors were thrown at that stage, but when attempting to access the routes, an error occurred stating - Property 'registerUser' does not exist on type &a ...

What is the process of invoking an external JavaScript function in Angular 5?

I recently downloaded a theme from this source. I need to specify script and CSS in the index.html file. The body section of index.html looks like this: <body> <app-root></app-root> <script type="text/javascript" src="./assets/js ...

Can you clarify the meaning behind Yarn's message about the pattern "debug@^4.1.1" attempting to unpack in the same destination?

I've been reading through other posts on Stack Overflow about the warning message I received from Yarn, but I'm still struggling to understand its true implications for my app. I want to know what this warning really signifies and how I can addre ...