diff --git a/pkg/platform/src/components/aws/astro.ts b/pkg/platform/src/components/aws/astro.ts index f81846efc..dabf4b5ed 100644 --- a/pkg/platform/src/components/aws/astro.ts +++ b/pkg/platform/src/components/aws/astro.ts @@ -569,7 +569,9 @@ export class Astro extends Component implements Link.Linkable { * Otherwise, it's the autogenerated CloudFront URL. */ public get url() { - return all([this.cdn?.domainUrl, this.cdn?.url]).apply( + if (!this.cdn) return; + + return all([this.cdn.domainUrl, this.cdn.url]).apply( ([domainUrl, url]) => domainUrl ?? url, ); } diff --git a/pkg/platform/src/components/aws/nextjs.ts b/pkg/platform/src/components/aws/nextjs.ts index becb435af..ff24ce2df 100644 --- a/pkg/platform/src/components/aws/nextjs.ts +++ b/pkg/platform/src/components/aws/nextjs.ts @@ -1288,7 +1288,9 @@ if(request.headers["cloudfront-viewer-longitude"]) { * Otherwise, it's the autogenerated CloudFront URL. */ public get url() { - return all([this.cdn?.domainUrl, this.cdn?.url]).apply( + if (!this.cdn) return; + + return all([this.cdn.domainUrl, this.cdn.url]).apply( ([domainUrl, url]) => domainUrl ?? url, ); } diff --git a/pkg/platform/src/components/aws/nuxt.ts b/pkg/platform/src/components/aws/nuxt.ts index fde21de32..2ebe418cb 100644 --- a/pkg/platform/src/components/aws/nuxt.ts +++ b/pkg/platform/src/components/aws/nuxt.ts @@ -450,7 +450,9 @@ export class Nuxt extends Component implements Link.Linkable { * Otherwise, it's the autogenerated CloudFront URL. */ public get url() { - return all([this.cdn?.domainUrl, this.cdn?.url]).apply( + if (!this.cdn) return; + + return all([this.cdn.domainUrl, this.cdn.url]).apply( ([domainUrl, url]) => domainUrl ?? url, ); } diff --git a/pkg/platform/src/components/aws/remix.ts b/pkg/platform/src/components/aws/remix.ts index 7d3f865ca..1b056ebe3 100644 --- a/pkg/platform/src/components/aws/remix.ts +++ b/pkg/platform/src/components/aws/remix.ts @@ -585,7 +585,9 @@ export class Remix extends Component implements Link.Linkable { * Otherwise, it's the autogenerated CloudFront URL. */ public get url() { - return all([this.cdn?.domainUrl, this.cdn?.url]).apply( + if (!this.cdn) return; + + return all([this.cdn.domainUrl, this.cdn.url]).apply( ([domainUrl, url]) => domainUrl ?? url, ); } diff --git a/pkg/platform/src/components/aws/solid-start.ts b/pkg/platform/src/components/aws/solid-start.ts index 6eadba390..24e2ede3d 100644 --- a/pkg/platform/src/components/aws/solid-start.ts +++ b/pkg/platform/src/components/aws/solid-start.ts @@ -462,7 +462,9 @@ export class SolidStart extends Component implements Link.Linkable { * Otherwise, it's the autogenerated CloudFront URL. */ public get url() { - return all([this.cdn?.domainUrl, this.cdn?.url]).apply( + if (!this.cdn) return; + + return all([this.cdn.domainUrl, this.cdn.url]).apply( ([domainUrl, url]) => domainUrl ?? url, ); } diff --git a/pkg/platform/src/components/aws/svelte-kit.ts b/pkg/platform/src/components/aws/svelte-kit.ts index 230dee057..18e7d7889 100644 --- a/pkg/platform/src/components/aws/svelte-kit.ts +++ b/pkg/platform/src/components/aws/svelte-kit.ts @@ -524,7 +524,9 @@ export class SvelteKit extends Component implements Link.Linkable { * Otherwise, it's the autogenerated CloudFront URL. */ public get url() { - return all([this.cdn?.domainUrl, this.cdn?.url]).apply( + if (!this.cdn) return; + + return all([this.cdn.domainUrl, this.cdn.url]).apply( ([domainUrl, url]) => domainUrl ?? url, ); }