Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/thirty-icons-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/astro": patch
---

Bug fix: Removed import.meta from integration to avoid breaking app during build.
19 changes: 9 additions & 10 deletions packages/astro/src/integration/create-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ function createIntegration<P extends { mode: 'hotload' | 'bundled' }>({ 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: {
Expand All @@ -51,6 +41,15 @@ function createIntegration<P extends { mode: 'hotload' | 'bundled' }>({ 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 =
Expand Down