diff --git a/src/application/console/commandRegistry.ts b/src/application/console/commandRegistry.ts index 127dda4..0925734 100644 --- a/src/application/console/commandRegistry.ts +++ b/src/application/console/commandRegistry.ts @@ -1,5 +1,6 @@ import * as fs from 'fs' import * as path from 'path' +import { pathToFileURL } from 'url' import Logger, { LoggerType } from '#application/logger' import { getAppPath } from '#application/storage' @@ -34,7 +35,7 @@ export class CommandRegistry { const filePath = getAppPath('commands', file.name) const commandName = path.basename(file.name, path.extname(file.name)) - const module = await import(filePath) + const module = await import(pathToFileURL(filePath).href) if (typeof module.default !== 'function') { this.logger.warn(`Unrecognized export in ${file.name}`) return