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
In ESM projects running on Windows, when Nightwatch attempts to import() a custom assertion, custom command, or page object, it fails as follows:
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ There was an error while trying to load the file │
│ C:\foo\bar.js: │
│ [ERR_UNSUPPORTED_ESM_URL_SCHEME] Only URLs with a scheme in: file, data are supported by the default ESM │
│ loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'; │
│ │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Switching to CommonJS, or running on a *nix operating system, works around the problem.
CommonJS
ESM
*nix
✔️
✔️
Windows
✔️
❌
Steps to reproduce
>git clone https://github.com/nchevsky/nightwatch-repro.git
>cd nightwatchjs-repro
>npm i -D
>npx nightwatch
Actual
There was an error while trying to load the file
C:\…\nightwatch-repro\nightwatch\custom-assertions\trueEqualsTrue.js:
[ERR_UNSUPPORTED_ESM_URL_SCHEME] Only URLs with a scheme in: file, data are supported by the default ESM
loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:';
Expected
[Esm Import Of Custom Assertion] Test Suite
───────────────────────────────────────────────────────────────────────────────
Using: chrome (109.0.5414.120) on WINDOWS.
– ESM import of custom assertion
√ true equals true (0ms)
Nightwatch.js Version
2.6.10
Node Version
18.12.1
Operating System
Windows 11
The text was updated successfully, but these errors were encountered:
Description of the bug/issue
💡 PR: #3585
In ESM projects running on Windows, when Nightwatch attempts to
import()
a custom assertion, custom command, or page object, it fails as follows:Switching to CommonJS, or running on a *nix operating system, works around the problem.
Steps to reproduce
Actual
Expected
Nightwatch.js Version
2.6.10
Node Version
18.12.1
Operating System
Windows 11
The text was updated successfully, but these errors were encountered: