Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find asset issue during cdk bootstrap #62

Open
gsivamani opened this issue Jan 10, 2024 · 5 comments
Open

Cannot find asset issue during cdk bootstrap #62

gsivamani opened this issue Jan 10, 2024 · 5 comments

Comments

@gsivamani
Copy link

gsivamani commented Jan 10, 2024

Hello team!

Encountering the below error during the cdk bootstrap step. Not sure if this is a new issue. Help appreciated. Thanks

cd react-ssr-lambda
cd ./cdk
npm install
npm run build
cdk bootstrap - failed here

Error: Cannot find asset at /home/gss/myprojects/react-ssr-lambda/simple-ssr/build
at new AssetStaging (/home/gss/myprojects/react-ssr-lambda/cdk/node_modules/aws-cdk-lib/core/lib/asset-staging.js:1:1402)
at new Asset (/home/gss/myprojects/react-ssr-lambda/cdk/node_modules/aws-cdk-lib/aws-s3-assets/lib/asset.js:1:736)
at Object.bind (/home/gss/myprojects/react-ssr-lambda/cdk/node_modules/aws-cdk-lib/aws-s3-deployment/lib/source.js:1:1185)
at /home/gss/myprojects/react-ssr-lambda/cdk/node_modules/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.js:1:3013
at Array.map ()
at new BucketDeployment (/home/gss/myprojects/react-ssr-lambda/cdk/node_modules/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.js:1:2994)
at new SsrStack (/home/gss/myprojects/react-ssr-lambda/cdk/lib/srr-stack.ts:44:5)
at Object. (/home/gss/myprojects/react-ssr-lambda/cdk/bin/cdk.ts:13:1)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module.m._compile (/home/gss/myprojects/react-ssr-lambda/cdk/node_modules/ts-node/src/index.ts:1618:23)

@glinisdev
Copy link

Same issue. There are no proper npm commands to build react app

@mitch-c-miller
Copy link

Also ran into this issue. You can get around it by manually adding the different services yourself, but it's definitely not the intended experience for a demo

@breskeby
Copy link

Hitting the same problem. @mitch-c-miller no idea how to do that though (creating different services myself. not even sure what's required)

@mitch-c-miller
Copy link

@breskeby the different TS files in cdk/lib are the blueprints to create the necessary resources. For example, this snippet

BucketDeployment creates a new S3 Bucket, with the ID "Client-side React app". It uploads build artifacts from ../simple-ssr/build/ in local storage to mySiteBucket, which is defined here.

If you're unfamiliar with AWS terminology, I strongly recommend checking out some tutorials on Youtube to get a rundown on the basics. AWS has a bunch of longstanding product names that are clever and cute when you know what they mean, but they're not useful otherwise (e.g. Route 53 is DNS since DNS uses port 53). AWS is dense and complicated, but the core concepts will get you very far!

@mitch-c-miller
Copy link

This should also be a more useful guide. It's actively maintained by AWS and includes more useful features like Cognito.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants