You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: ERR_UNSUPPORTED_ESM_URL_SCHEME on Windows when using codecept.conf.ts #5581
Run npx codeceptjs check to validate a TypeScript configuration file (codecept.conf.ts) on Windows.
What do you get instead?
The command fails with ERR_UNSUPPORTED_ESM_URL_SCHEME. CodeceptJS 4 transpiles the .ts config to a temp .js file and then calls import(tempFile) with a raw Windows absolute path (e.g. c:\Users\...\tempXXXX.js). The Node.js ESM loader on Windows only accepts file:// URLs — it treats c: as an unsupported URL scheme and throws.
Root cause
The issue is in lib/config.js line 245 (and 261):
configModule=awaitimport(tempFile)// tempFile = "c:\Users\...\tempXXXX.js" on Windows
Proposed fix — convert the path to a file:// URL before importing:
This issue only affects Windows. Unix absolute paths (/home/...) are accepted by the ESM loader, while Windows drive-letter paths (c:\...) are not.
Console output
√ CONFIG Framework
Global functions are deprecated. Use `import { Helper, within, session } from "codeceptjs"` instead. Set `noGlobals: true` in config to disable globals.
Error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:241:11)
at defaultLoad (node:internal/modules/esm/load:132:3)
at ModuleLoader.load (node:internal/modules/esm/loader:724:12)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:543:56)
at ModuleLoader.#createModuleJob (node:internal/modules/esm/loader:567:36)
at ModuleLoader.#getJobFromResolveResult (node:internal/modules/esm/loader:297:34)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:265:41)
at async ModuleLoader.import (node:internal/modules/esm/loader:605:23) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
Test source code
N/A — the error occurs during config loading, before any test runs.
Activity
kobenguyent commentedon Jun 3, 2026
@mmaaxi may you help check if #5595 resolves the windows issues?
kobenguyent commentedon Jun 8, 2026
supposed to be fixed by https://github.com/codeceptjs/CodeceptJS/releases/tag/4.0.4. Closing for now. Don't hesitate to report back if something still broken. Thanks!