aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
461 stars 116 forks source link

SSR Image Optimization Feature - unable to deploy #3873

Closed alexnguyennz closed 6 months ago

alexnguyennz commented 11 months ago

Before opening, please confirm:

App Id

d1palg3fcdvx2w

AWS Region

us-east-1

Amplify Hosting feature

SSR

Question

Hi I'm having issues deploying a project using a deploy manifest with Image Optimization routes and settings.

For example, using the default examples from this page and this one (under "The following example demonstrates the imageSettings attribute"):

// have omitted other routes and the required settings e.g. `computeResources`, `framework`
{
          version: 1,
          routes: [
            {
              path: "/images/*",
              target: {
                kind: "ImageOptimization",
                cacheControl: "public, max-age=31536000, immutable",
              },
            },
          ],
          imageSettings: {
            sizes: [100, 200],
            domains: ["example.com"],
            remotePatterns: [
              {
                protocol: "https",
                hostname: "example.com",
                port: "",
                pathname: "/**",
              },
            ],
            formats: ["image/webp"],
            minumumCacheTTL: 60,
            dangerouslyAllowSVG: false,
          }
        }

leads to an error of We failed to validate the deploy-manifest.json file found in your build output directory - An invalid 'deploy-manifest.json' file was provided.. I've tried a few different variations but am not able to get past this error. Any idea what needs to be changed?

Thanks for any assistance.

gentksb commented 6 months ago

Did you define compute route?

If you specify an ImageOptimization route, you must also specify a Compute route. This is required because image optimization is not yet supported for purely static applications. https://docs.aws.amazon.com/amplify/latest/userguide/ssr-deployment-specification.html

alexnguyennz commented 6 months ago

Hi I found out a few months ago that this was actually due to a typo in the AWS documentation example for the spec so that was throwing off the build. Forgot about this issue. Thanks.

github-actions[bot] commented 6 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] commented 6 months ago

This issue has been automatically locked.