From 72e6039015a57551cc6b7194af5c907c5e3a9cc8 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Mon, 8 Jul 2024 20:32:50 +0300 Subject: [PATCH 1/2] fix(astro): Accessing import.meta at build causes app to break --- .../src/integration/create-integration.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/astro/src/integration/create-integration.ts b/packages/astro/src/integration/create-integration.ts index 365fddd6a12..d695e767d03 100644 --- a/packages/astro/src/integration/create-integration.ts +++ b/packages/astro/src/integration/create-integration.ts @@ -25,16 +25,6 @@ function createIntegration

({ mode }: const clerkJSVariant = (params as any)?.clerkJSVariant as string | undefined; const clerkJSVersion = (params as any)?.clerkJSVersion as string | undefined; - const internalParams: ClerkOptions = { - ...params, - sdkMetadata: { - version: packageVersion, - name: packageName, - // eslint-disable-next-line turbo/no-undeclared-env-vars - environment: import.meta.env.MODE, - }, - }; - return { name: '@clerk/astro/integration', hooks: { @@ -51,6 +41,15 @@ function createIntegration

({ mode }: logger.error('Invalid value for clerkJSVariant. Acceptable values are `"headless"`, `""`, and `undefined`'); } + const internalParams: ClerkOptions = { + ...params, + sdkMetadata: { + version: packageVersion, + name: packageName, + environment: command === 'dev' ? 'development' : 'production', + }, + }; + const defaultBundledImportPath = `${packageName}/internal/bundled`; const buildImportPath = From 282cce2beb5159032359caab3e834b9a6179a177 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Mon, 8 Jul 2024 20:34:00 +0300 Subject: [PATCH 2/2] fix(astro): Add changeset --- .changeset/thirty-icons-laugh.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/thirty-icons-laugh.md diff --git a/.changeset/thirty-icons-laugh.md b/.changeset/thirty-icons-laugh.md new file mode 100644 index 00000000000..9a0d71edb9f --- /dev/null +++ b/.changeset/thirty-icons-laugh.md @@ -0,0 +1,5 @@ +--- +"@clerk/astro": patch +--- + +Bug fix: Removed import.meta from integration to avoid breaking app during build.