File tree Expand file tree Collapse file tree
packages/astro/src/integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ import type { AstroClerkIntegrationParams } from '../types';
88import { vitePluginAstroConfig } from './vite-plugin-astro-config' ;
99
1010const buildEnvVarFromOption = ( valueToBeStored : unknown , envName : keyof InternalEnv ) => {
11- return valueToBeStored ? { [ `import.meta.env.${ envName } ` ] : JSON . stringify ( valueToBeStored ) } : { } ;
11+ // Always return a value to ensure Vite properly replaces previous definitions
12+ // For undefined values, use the literal 'undefined' identifier instead of a string
13+ const value = valueToBeStored !== undefined ? JSON . stringify ( valueToBeStored ) : 'undefined' ;
14+ return { [ `import.meta.env.${ envName } ` ] : value } ;
1215} ;
1316
1417type HotloadAstroClerkIntegrationParams = AstroClerkIntegrationParams & {
You can’t perform that action at this time.
0 commit comments