squint-cljs / squint

Light-weight ClojureScript dialect
https://squint-cljs.github.io/squint
671 stars 44 forks source link

squint run disfunctional on windows #542

Closed crestofthebeast closed 4 months ago

crestofthebeast commented 4 months ago

version

Package.json reports "^0.8.112".

problem

squint run crashes and returns errors on windows 11

repro

[ Please provide a minimal and complete reproduction of the problem, preferably something which can be run with Node.js without dependencies. ] 1) Initialise a barebones squint project:

mkdir repro
cd repro
npm init -y
npm install squint-cljs@latest

2) Create a file, eg.cljs

(ns eg)

(println :test)

3) Run eg.cljs with squint

PS C:\Users\pekom\Documents\dev\clj\repro> npx squint run eg.cljs 
[squint] Running eg.cljs
node:internal/errors:496
    ErrorCaptureStackTrace(err);
    ^

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 new NodeError (node:internal/errors:405:5)
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:138:11)
    at defaultLoad (node:internal/modules/esm/load:89:3)
    at DefaultModuleLoader.load (node:internal/modules/esm/loader:263:26)
    at DefaultModuleLoader.moduleProvider (node:internal/modules/esm/loader:179:22)       
    at new ModuleJob (node:internal/modules/esm/module_job:63:26)
    at #createModuleJob (node:internal/modules/esm/loader:203:17)
    at DefaultModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:156:34)
    at DefaultModuleLoader.getModuleJob (node:internal/modules/esm/loader:141:17)
    at DefaultModuleLoader.import (node:internal/modules/esm/loader:227:28) {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

Node.js v20.5.0

expected behavior

Code running. As previously discussed in slack, squint compile works, so this must just be an issue somewhere with run.