Environment
Win10
Node.js v20.12.1
NPM 10.5.0
Steps to Reproduce
- Clone project
- npm i
- Copy demo.mjs file from web-benchmark-demo repo
export class MyScenario {
async run(browser, page) {
await page.goto('https://sentry.io/welcome/');
await page.getByRole('navigation').getByRole('link', { name: 'Pricing' }).click();
}
}
- run
node bin/cli.mjs -f demo.mjs
Expected Result
Test run starts
Actual Result
Error is shown
node:internal/modules/esm/load:239
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed, schemes);
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: 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:239:11)
at defaultLoad (node:internal/modules/esm/load:130:3)
at ModuleLoader.load (node:internal/modules/esm/loader:403:13)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:285:56)
at new ModuleJob (node:internal/modules/esm/module_job:67:26)
at #createModuleJob (node:internal/modules/esm/loader:297:17)
at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:254:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:235:17)
at async ModuleLoader.import (node:internal/modules/esm/loader:322:23) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
Workaround
Update cli.mjs line 43
const modules = await Promise.all(file.map(async f => import(`${path.resolve('./', f)}`)));
to
const modules = await Promise.all(file.map(async f => import(`file:///${path.resolve('./', f)}`)));
This blog post directed me to this repo: https://sentry.engineering/blog/measuring-session-replay-overhead
It does not state anything about OS compatibility, was a bit waste of time to figure out it by myself (being a non Node developer).
Blog post could emphasize that the benchmarks does not work on Windows.
Environment
Win10
Node.js v20.12.1
NPM 10.5.0
Steps to Reproduce
node bin/cli.mjs -f demo.mjsExpected Result
Test run starts
Actual Result
Error is shown
Workaround
Update cli.mjs line 43
const modules = await Promise.all(file.map(async f => import(`${path.resolve('./', f)}`)));to
const modules = await Promise.all(file.map(async f => import(`file:///${path.resolve('./', f)}`)));This blog post directed me to this repo: https://sentry.engineering/blog/measuring-session-replay-overhead
It does not state anything about OS compatibility, was a bit waste of time to figure out it by myself (being a non Node developer).
Blog post could emphasize that the benchmarks does not work on Windows.