diff --git a/.changeset/four-onions-clap.md b/.changeset/four-onions-clap.md new file mode 100644 index 0000000000..44d0cf9ae7 --- /dev/null +++ b/.changeset/four-onions-clap.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Fix for the new backend `start` command to make it work on Windows. diff --git a/packages/cli/src/lib/experimental/startBackendExperimental.ts b/packages/cli/src/lib/experimental/startBackendExperimental.ts index 3bc603a9da..1272ba9e66 100644 --- a/packages/cli/src/lib/experimental/startBackendExperimental.ts +++ b/packages/cli/src/lib/experimental/startBackendExperimental.ts @@ -21,7 +21,7 @@ import type { ChildProcess } from 'child_process'; import { IpcServer } from './IpcServer'; import { ServerDataStore } from './ServerDataStore'; import debounce from 'lodash/debounce'; -import { fileURLToPath } from 'url'; +import { fileURLToPath, pathToFileURL } from 'url'; import { isAbsolute as isAbsolutePath } from 'path'; import { paths } from '../paths'; import spawn from 'cross-spawn'; @@ -30,7 +30,7 @@ const loaderArgs = [ '--require', require.resolve('@esbuild-kit/cjs-loader'), '--loader', - require.resolve('@esbuild-kit/esm-loader'), + pathToFileURL(require.resolve('@esbuild-kit/esm-loader')).toString(), // Windows prefers a URL here ]; export async function startBackendExperimental(options: BackendServeOptions) {