diff --git a/packages/sparkling-app-cli/src/config.ts b/packages/sparkling-app-cli/src/config.ts index c620c683..c4920bae 100644 --- a/packages/sparkling-app-cli/src/config.ts +++ b/packages/sparkling-app-cli/src/config.ts @@ -218,7 +218,10 @@ function loadAppConfigViaEsm(cwd: string, configPath: string, originalError?: un const tempDir = path.resolve(cwd, '.sparkling'); fs.mkdirSync(tempDir, { recursive: true }); const readerScript = path.join(tempDir, 'read-app-config.mjs'); - const fileUrl = pathToFileURL(configPath).href; + // On Windows with Node.js v24, pathToFileURL has a bug with backslash paths + // Convert to forward slashes before passing to pathToFileURL + const normalizedPath = configPath.split(path.sep).join('/'); + const fileUrl = pathToFileURL(normalizedPath).href; const script = [ `const url = ${JSON.stringify(fileUrl)};`, 'const mod = await import(url);', @@ -239,6 +242,7 @@ function loadAppConfigViaEsm(cwd: string, configPath: string, originalError?: un cwd, stdio: ['ignore', 'pipe', 'pipe'], env: process.env, + shell: process.platform === 'win32' ? true : false, }); if (res.status !== 0) { diff --git a/packages/sparkling-app-cli/src/utils/exec.ts b/packages/sparkling-app-cli/src/utils/exec.ts index 9b3da7a1..004eb7df 100644 --- a/packages/sparkling-app-cli/src/utils/exec.ts +++ b/packages/sparkling-app-cli/src/utils/exec.ts @@ -29,7 +29,7 @@ export async function runCommand( cwd: options.cwd, env: { ...process.env, ...options.env }, stdio: 'inherit', - shell: false, + shell: process.platform === 'win32' ? true : false, }); await new Promise((resolve, reject) => {