I uploaded to S3 below files:
But server returns below content:
Especially the gray one is strange: it does not seems like file. It's name (filename?) is ID from URN:
https://XXXX.com/product/53483ca1-9fd1-4970-841d-e9fbeadd4660
But when I checked the content of EntryPoint__fd6b122d5ca60cd57ec5.js
, Main.css
, I saw the same HTML code as in picture above (by other words, content of 53483ca1-9fd1-4970-841d-e9fbeadd4660
, Main.css
and EntryPoint__fd6b122d5ca60cd57ec5.js
is even).
I have error:
Uncaught SyntaxError: Unexpected token '<'
EntryPoint__fd6b122d5ca60cd57ec5.js:1
To solve this error, first I need to understand what CloudFront/S3 did with my files. What is gray one? Where it's name has been set?
Anyway, it did something wrong: EntryPoint__fd6b122d5ca60cd57ec5.js
has HTML content, and certainly
JavaScript can not parse it.
const applicationDeployment = ({
targetFilesGlobSelections,
targetIsFunctionalTesting = false
}) =>
Gulp.src(targetFilesGlobSelections)
.pipe(GulpPlugins.plumber({
errorHandler: (error) => {
console.error("Task: 'DeployApplication', error occurred:");
console.error(error);
NodeNotifier.notify({
title: "Task: 'DeployApplication', error occurred:",
message: error.message
});
}
}))
.pipe(GulpPlugins.s3(
targetIsFunctionalTesting ? AMAZON_S3_DEPLOYMENT_CONFIG__FUNCTIONAL_STAGING : AMAZON_S3_DEPLOYMENT_CONFIG__PRODUCTION
));
Gulp.task("Deployment to production", () => applicationDeployment({
targetFilesGlobSelections: `${public}/**/**`
}));
As mentioned in 5th point, let elaborate the Lambda@Edge more! There are many uses for Lambda@Edge processing. For example:
I hope it can help you to understand what happened to your files. By the in inspect grey files mean HTML, orange/yellow mean javascript or .js file and blue mean css file.
Following is the example of my files!