Skip to content
Open
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
6 changes: 5 additions & 1 deletion packages/sparkling-app-cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);',
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/sparkling-app-cli/src/utils/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>((resolve, reject) => {
Expand Down