clio-lang / clio

Clio is a functional, parallel, distributed programming language.
https://clio-lang.org
Apache License 2.0
936 stars 30 forks source link

On Windows, absolute paths must be valid file:// URLs. #234

Open 2gua opened 3 years ago

2gua commented 3 years ago

Describe the bug

When running "clio run" on Windows, the following bug appears: 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 'd:' at new NodeError (node:internal/errors:371:5) at defaultResolve (node:internal/modules/esm/resolve:983:11) at ESMLoader.resolve (node:internal/modules/esm/loader:422:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40) at ESMLoader.import (node:internal/modules/esm/loader:276:22) at importModuleDynamically (node:internal/modules/esm/translators:111:35) at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14) at file:///D:/.../build/node_modules/clio-run/src/workers/wt.js:14:19 at ModuleJob.run (node:internal/modules/esm/module_job:185:25) at async Promise.all (index 0) Emitted 'error' event on Worker instance at: at Worker.[kOnErrorMessage] (node:internal/worker:289:10) at Worker.[kOnMessage] (node:internal/worker:300:37) at MessagePort. (node:internal/worker:201:57) at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:562:20) at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) { code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'

Temporary solutions

.../build/node_modules/clio-run/src/workers/wt.js: import(workerData.file) to import("file://" + workerData.file)

.../build/node_modules/clio-run/src/runners/wt.js: import(file) to import("file://" + file)

pouya-eghbali commented 3 years ago

Hi, thanks for reporting! I will work on this as a part of the next release!