diff --git a/packages/studio-plugin/src/types/CliArgs.ts b/packages/studio-plugin/src/types/CliArgs.ts index 385121e05..8f0878cac 100644 --- a/packages/studio-plugin/src/types/CliArgs.ts +++ b/packages/studio-plugin/src/types/CliArgs.ts @@ -8,5 +8,5 @@ export interface CliArgs { // This option is always provided by the cac package, and we only use it to // configure Studio to run in React Strict Mode for internal development by // using `-- strict`. - "--": string[]; + "--"?: string[]; } diff --git a/packages/studio/bin/studio.ts b/packages/studio/bin/studio.ts index 61fd5e508..9e3e25946 100755 --- a/packages/studio/bin/studio.ts +++ b/packages/studio/bin/studio.ts @@ -16,7 +16,7 @@ cli .option("--port ", "[number] port to run studio") .option("--root ", `[string] path to the root directory`) .action((options: CliArgs) => { - const useStrictMode = options["--"].includes("strict"); + const useStrictMode = options["--"]?.includes("strict"); spawnSync( "npx", [ @@ -33,7 +33,7 @@ cli env: { ...process.env, YEXT_STUDIO_ARGS: JSON.stringify(options), - VITE_STUDIO_STRICT: String(useStrictMode), + VITE_STUDIO_STRICT: String(useStrictMode ?? false), }, shell: true, }