ACPixel
03/06/2022, 12:25 AMCannot find asset at ...
It seems that with SST bunding the typescript code of the main app, the package is losing it's __dirname.
The code for the asset is:
const codeAsset = new Asset(this, "ec2-code-asset", {
path: path.join(__dirname, "/lib/index.js"),
});
// 👇 create the EC2 CloudformationInit data
const initData = CloudFormationInit.fromElements(
InitFile.fromExistingAsset("/home/ec2-user/app/index.js", codeAsset)
);
I'm not quite sure how to fix this, as the asset should be reading the file located within the NPM package I have made here, however it keeps trying to read it from the sst .build directoryFrank
package.json
? SST shouldn’t be bundling any dependencies https://github.com/serverless-stack/serverless-stack/blob/master/packages/core/src/stacks/build.ts#L17-L24ACPixel
03/06/2022, 1:57 AMACPixel
03/06/2022, 1:57 AMACPixel
03/06/2022, 2:02 AM