diff --git a/app/sitemap.ts b/app/sitemap.ts index 9d85030c1..fe8ed96ac 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -12,7 +12,7 @@ const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL : 'http://localhost:3000'; export default async function sitemap(): Promise { - validateEnvironmentVariables() + validateEnvironmentVariables(); const routesMap = [''].map((route) => ({ url: `${baseUrl}${route}`, diff --git a/lib/utils.ts b/lib/utils.ts index 7c9310f90..cfbd57533 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -21,10 +21,19 @@ export const validateEnvironmentVariables = () => { }); if (missingEnvironmentVariables.length) { - throw new Error(`The following environment variables are missing. Your site will not work without them.\n\n${missingEnvironmentVariables.join('\n')}\n`); + throw new Error( + `The following environment variables are missing. Your site will not work without them.\n\n${missingEnvironmentVariables.join( + '\n' + )}\n` + ); } - if (process.env.SHOPIFY_STORE_DOMAIN?.includes('[') || process.env.SHOPIFY_STORE_DOMAIN?.includes(']')) { - throw new Error('Your `SHOPIFY_STORE_DOMAIN` environment variable includes brackets (ie. `[` and / or `]`). Your site will not work with them there. Please remove them.'); + if ( + process.env.SHOPIFY_STORE_DOMAIN?.includes('[') || + process.env.SHOPIFY_STORE_DOMAIN?.includes(']') + ) { + throw new Error( + 'Your `SHOPIFY_STORE_DOMAIN` environment variable includes brackets (ie. `[` and / or `]`). Your site will not work with them there. Please remove them.' + ); } -} +};