From 2878f4ba758fc5c6b4a66972bb2cc9b7d8c5bf8c Mon Sep 17 00:00:00 2001 From: Vladyslav Bondarchuk Date: Tue, 16 Jun 2026 23:36:48 +0300 Subject: [PATCH 1/2] Update route loading to use pathToFileURL for Windows-compatible dynamic imports --- lib/router.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/router.js b/lib/router.js index 27e56e0..1745eec 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1,4 +1,5 @@ import path from 'node:path'; +import { pathToFileURL } from 'node:url'; import { readdir } from 'node:fs/promises'; import Channel from './channel.js'; import config from '../config.js'; @@ -55,7 +56,9 @@ const loadRoutes = async () => { const files = (await readdir(config.ROUTES_DIR)).sort(); for (const file of files) { if (!file.endsWith('.js') || file === 'static.js') continue; - const mod = await import(path.join(config.ROUTES_DIR, file)); + const mod = await import( + pathToFileURL(path.join(config.ROUTES_DIR, file)).href + ); if (!isRouteMap(mod.default)) continue; table[path.basename(file, '.js')] = makeHandler(mod.default); } From 17dfe551908c481ecb74440cbc6069d3128b8231 Mon Sep 17 00:00:00 2001 From: Timur Shemsedinov Date: Wed, 17 Jun 2026 12:07:53 +0300 Subject: [PATCH 2/2] Update lib/router.js --- lib/router.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/router.js b/lib/router.js index 1745eec..245f34f 100644 --- a/lib/router.js +++ b/lib/router.js @@ -56,9 +56,9 @@ const loadRoutes = async () => { const files = (await readdir(config.ROUTES_DIR)).sort(); for (const file of files) { if (!file.endsWith('.js') || file === 'static.js') continue; - const mod = await import( - pathToFileURL(path.join(config.ROUTES_DIR, file)).href - ); + const routePath = path.join(config.ROUTES_DIR, file); + const routeUrl = pathToFileURL(routePath).href; + const mod = await import(routeUrl); if (!isRouteMap(mod.default)) continue; table[path.basename(file, '.js')] = makeHandler(mod.default); }