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
[BUG] Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
#12307
Closed
frederikhors opened this issue
Feb 23, 2022
· 3 comments
· Fixed by #12357
@bbigrashere suggests how to work with Typescript using PW_EXPERIMENTAL_TS_ESM.
On Windows 10 this doesn't work:
(node:12372) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at new NodeError (node:internal/errors:371:5)
at throwIfUnsupportedURLProtocol (node:internal/modules/esm/resolve:1033:11)
at defaultResolve (node:internal/modules/esm/resolve:1103:3)
at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
at ESMLoader.import (node:internal/modules/esm/loader:332:22)
at initializeLoader (node:internal/process/esm_loader:74:49)
at loadESM (node:internal/process/esm_loader:87:11)
at runMainESM (node:internal/modules/run_main:51:21)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:74:5) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
WSL is not an option because I cannot install it and I wanna use Windows 10 natively.
The text was updated successfully, but these errors were encountered:
@frederikhors could you provide us a minimal reproducible? So we know how your code looks like, maybe there is some kind of "interesting" import which our transformation logic does not take care of.
Error: playwright.config.ts: Cannot import a typescript file from an esmodule.
If you run $env:PW_EXPERIMENTAL_TS_ESM="1"; npx playwright test or $env:PW_EXPERIMENTAL_TS_ESM=1; npx playwright test:
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
Context:
@playwright/test: 1.19.1
REPL:
https://github.com/frederikhors/iss-playwright-typescript
Describe the bug
@mxschmitt asked me to open a new issue here: #12138 (comment).
The issue is:
@bbigras here suggests how to work with Typescript using
PW_EXPERIMENTAL_TS_ESM
.On Windows 10 this doesn't work:
WSL is not an option because I cannot install it and I wanna use Windows 10 natively.
The text was updated successfully, but these errors were encountered: