Skip to content

CodeceptJS v4 cannot load config on Windows #5588

Description

@danielrentz

CodeceptJS fails to load config file on Windows (tried in powershell and git bash):

$ pnpm codeceptjs run
Error: Failed to load config file C:\test\e2e\codecept.conf.js:
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 loadConfigFile (file:///C:/test/e2e/node_modules/.pnpm/codeceptjs@4.0.2_@types+node@25.9.0/node_modules/codeceptjs/lib/config.js:272:15)
    at async Config.load (file:///C:/test/e2e/node_modules/.pnpm/codeceptjs@4.0.2_@types+node@25.9.0/node_modules/codeceptjs/lib/config.js:124:16)
    at async getConfig (file:///C:/test/e2e/node_modules/.pnpm/codeceptjs@4.0.2_@types+node@25.9.0/node_modules/codeceptjs/lib/command/utils.js:16:12)
    at async default (file:///C:/test/ui/e2e/node_modules/.pnpm/codeceptjs@4.0.2_@types+node@25.9.0/node_modules/codeceptjs/lib/command/run.js:19:16)
    at async Command.<anonymous> (file:///C:/test/e2e/node_modules/.pnpm/codeceptjs@4.0.2_@types+node@25.9.0/node_modules/codeceptjs/bin/codecept.js:40:7)

passing a file URL fails as well:

$ pnpm codeceptjs run -c "file:///C:/test/e2e/codecept.config.js"
Error: Config file C:\test\e2e\file:\C:\test\e2e\codecept.config.js does not exist. Execute 'codeceptjs init' to create config

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions