Closed bzorn closed 2 days ago
The default behavior of the "+" button in the GenAIScript panel is to create a .mjs file (not a .js file). This appears to cause the issue observed above. When I use the same prompt in a .js file the script executes correctly.
- Error: 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:'
Good catch. This is a windows issue with the new javascript/typescript loader.
fixed in 1.42.3
Type: Bug
Describe the issue
I have a minimal script that just has a prompt. When I execute it I get an error. The error message is below.
To Reproduce
Create a script that takes no input (just has a prompt). Run it with the "Run" button in the VS Code UI. I get an error message instead of the script running.
Expected behavior
A clear and concise description of what you expected to happen.
Environment
vscode: 1.90.2 extension: 1.42.0
Trace
.env
file.💾 script
- temperature: 0.8🏡 env
🧬 prompt
📓 script source
```js wrap $`Tell me a joke` ```❌ Errors
- Error: 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:' - 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:' > ```````markdown> 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 nextLoad (node:internal/modules/esm/hooks:866:28) > at load (file:///c:/Users/zorn/.vscode/extensions/genaiscript.genaiscript-vscode-1.42.0/node_modules/tsx/dist/esm/index.mjs?1719875985997:2:1768) > at nextLoad (node:internal/modules/esm/hooks:866:28) > at Hooks.load (node:internal/modules/esm/hooks:449:26) > at handleMessage (node:internal/modules/esm/worker:196:24) > at Immediate.checkForMessages (node:internal/modules/esm/worker:138:28) > at process.processImmediate (node:internal/timers:478:21) > ```````vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 chatpanelc:31048052 dsvsc021:30996838 jg8ic977:31013176 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 2f103344:31071589 impr_priority:31082723