From f97a89dc2807c0b63cc9782ec385585f4801d4b6 Mon Sep 17 00:00:00 2001 From: Michael Clark <5285928+MikesGlitch@users.noreply.github.com> Date: Wed, 25 Feb 2026 15:00:10 +0000 Subject: [PATCH] :bug: Fix file path on windows (#7076) * fix file path on windows * file path in migrations * release notes --- packages/sync-server/src/migrations.ts | 6 ++++-- upcoming-release-notes/7076.md | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 upcoming-release-notes/7076.md diff --git a/packages/sync-server/src/migrations.ts b/packages/sync-server/src/migrations.ts index 363036e9c1..a5c22d7eb0 100644 --- a/packages/sync-server/src/migrations.ts +++ b/packages/sync-server/src/migrations.ts @@ -1,6 +1,6 @@ import { readdir } from 'node:fs/promises'; import path, { dirname } from 'node:path'; -import { fileURLToPath } from 'node:url'; +import { fileURLToPath, pathToFileURL } from 'node:url'; import { load } from 'migrate'; @@ -30,7 +30,9 @@ export async function run(direction: 'up' | 'down' = 'up'): Promise { for (const f of files .filter(f => f.endsWith('.js') || f.endsWith('.ts')) .sort()) { - migrationsModules[f] = await import(path.join(migrationsDir, f)); + migrationsModules[f] = await import( + pathToFileURL(path.join(migrationsDir, f)).href + ); } return new Promise((resolve, reject) => { diff --git a/upcoming-release-notes/7076.md b/upcoming-release-notes/7076.md new file mode 100644 index 0000000000..650997cf66 --- /dev/null +++ b/upcoming-release-notes/7076.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MikesGlitch] +--- + +Fix server migrations when running on Windows