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:

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

Setting up node.js for angular - serving static files with connect.static and running unit tests

Currently, I am in the process of setting up a basic node webserver by following a tutorial outlined in Pro AngularJS published by Apress. Node.js along with both the connect and karma modules have been successfully installed on my system. During the ins ...

Encountering a TypeScript React issue with passing objects to context in code

Within my project, there is a context provider that acts as an object containing various properties: <Provider value={ { scaleNum: scaleNum, // number scaleLet: scaleLet, // string ...

What steps can I take to ensure that the elements are in the same row instead of being displayed in three separate rows?

(I'm a beginner in web development and need some help) Is there a way to align elements into the same row instead of stacking them up in separate rows? I'm working on creating a header bar similar to the one on the Naive UI Documentation Website. ...

Attempted to run npm install -g truffle but encountered a gyp error

I attempted npm node-gyp -g without success. The goal is to install truffle on my Mac running macOS Catalina, with node version 16.13.1 and npm version 8.1.2. npm ERR! code 1 npm ERR! path /usr/local/lib/node_modules/truffle/node_modules/ganache/node_mod ...

Issue with rendering images retrieved from JSON data

Struggling with displaying images in my Ionic and Angular pokedex app. The JSON file data service pulls the image paths, but only displays the file path instead of the actual image. Any ideas on what might be causing this issue? Sample snippet from the JS ...

What is the best way to simulate an overloaded method in jest?

When working with the jsonwebtoken library to verify tokens in my module, I encountered a situation where the verify method is exported multiple times with different signatures. export function verify(token: string, secretOrPublicKey: Secret, options?: Ve ...

What is the best way for a function to accommodate various types that adhere to an interface?

How can we create a function that can accept multiple types with a common interface? Let's consider the example: interface A {a: number} type B = {b: string;} & A type C = {c: string;} & A function acceptA(a: A) { return a } acceptA({a ...

Receive the most recent query in a Nuxt plugin following the completion of page loading

So, here's the issue - I have a plugin containing some functions that are supposed to update URL queries. However, every time I run $global.changePage(2) or $global.changeLimit(2), the console.log(query) outputs an empty object and doesn't show t ...

Encountering difficulties when attempting to start a new project in Angular

I am encountering an issue while trying to create new in Angular, using version 6 and Node.js v8.11 Here is the console log: Unable to save binary /home/amit/demo/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir ...

The module cannot be located due to an error: Package path ./dist/style.css is not being exported from the package

I am facing an issue with importing CSS from a public library built with Vite. When I try to import the CSS using: import 'rd-component/dist/style.css'; I encounter an error during the project build process: ERROR in ./src/page/photo/gen/GenPhot ...

Ensuring Consistency of Values Between Child and Parent Components

Is there a way to ensure that the value of submitted in the child component always matches the value of submitted in the parent component? Appreciate any help! @Component({ selector: 'child-cmp', template: ` child:{{submitted}} ...

Warning: Node.js/NPM alert - repository not found during installation of packages such as MongoDB and others

After I tried installing mongodb, I encountered a lengthy warning list that caught my attention: I am bewildered by this issue. The warnings seem quite severe to me and the mention of Visual Studio 2013 has left me puzzled. Is it safe to overlook these wa ...

Optimal approach for designing interfaces

I have a situation where I have an object retrieved from the database, which includes assignee and author ID properties that refer to user objects. As I transform a number into a user object, I am unsure about the best practice for defining the type of the ...

Struggling to chart out the post response in Angular 7

I am facing an issue while setting up a service on Angular version 7. The problem arises with the res.json() method, throwing an error stating Property 'json' does not exist on type 'Object'. Below is my service's code: import {In ...

Issue with Bower installation: "Arguments passed to path.join must be string types"

Recently, I created a new node project and attempted to install jQuery using bower. bower install jquery However, I encountered the following error: bower jquery#* not-cached git://github.com/jquery/jquery.git#* bower jquery#* ...

Increasing the number of service providers in Angular2-4 directives

Is there a way to apply both * to a string? Below is the code snippet I am working with: <a class="sidenav-anchor" *ngIf="!item.hasSubItems()" md-list-item md-ripple [routerLink]="[item.route]" routerLinkActive="active" [routerLinkActiveOptions]="{ex ...

How come the props aren't being passed from the parent to the child component? (React / TypeScript)

Learning TypeScript for the first time and facing an issue with passing props from parent to child components. The error seems to be related to the type of props, but I'm not sure how to fix it since all types seem correct. Error message: "Property ...

The properties are not found in the type 'Observable<Todo[]>'

I'm currently following a YouTube tutorial and I've hit a roadblock trying to figure out where the error is originating from? Error Message: Type 'Observable' is missing properties such as length, pop, push, concat, and 25 more.ts(2740 ...

Managing various private npm repositories from Github on a single server

Currently, I have a node application hosted on GitHub within a private repository. In addition to the main application, there are custom modules that have been developed separately and stored in their own private repositories. Here is an example URL for t ...

Do ES6 features get transpiled into ES5 when utilized in TypeScript?

After implementing ES6 features such as template strings, arrow functions, and destructuring in a TypeScript file, I compile the code to regular JavaScript... Does the TypeScript compiler also compile the ES6 syntax, or do I need to utilize another compil ...