Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple GenAIScript failing #565

Closed
bzorn opened this issue Jul 1, 2024 · 3 comments
Closed

Simple GenAIScript failing #565

bzorn opened this issue Jul 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@bzorn
Copy link
Collaborator

bzorn commented Jul 1, 2024

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

## test1



<details class="genaiscript">
<summary>
⚙️ configuration
</summary>

-   model: openai:gpt-4
-   base: https://tnrllmproxy.azurewebsites.net/openai/deployments
-   type: azure
-   source: env: OPENAI_API_...

</details>



<details class="genaiscript">
<summary>
🤖 automation
</summary>

Use the command line interface [run](https://microsoft.github.io/genaiscript/reference/cli/run/) to automate this task:

```bash
npx --yes genaiscript@^1.42.0 run test1 --apply-edits --model openai:gpt-4
```


-   You will need to install [Node.js LTS](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
-   The cli uses the same secrets in the `.env` file.

</details>



<details class="genaiscript">
<summary>
💾 script
</summary>

-   temperature: 0.8


<details class="genaiscript">
<summary>
🏡 env
</summary>


</details>



<details class="genaiscript">
<summary>
🧬 prompt
</summary>



<details class="genaiscript">
<summary>
📓 script source
</summary>


```js wrap
$`Tell me a joke`
```

</details>

-   import: C:\Users\zorn\OneDrive - Microsoft\AI CoArch\RobustPrompt\genaisrc\test1.genai.mjs, parent: c:\Users\zorn\.vscode\extensions\genaiscript.genaiscript-vscode-1.42.0\genaiscript.cjs
-   📦 imported: c:\Users\zorn\OneDrive - Microsoft\AI CoArch\RobustPrompt\genaisrc\test1.genai.mjs
-   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:'

</details>


</details>



<details class="genaiscript">
<summary>
❌ Errors
</summary>

-   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)
> ```````

</details>


Extension version: 1.42.0
VS Code version: Code 1.90.2 (5437499feb04f7a586f677b155b039bc2b3669eb, 2024-06-18T22:34:26.404Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs Intel(R) Xeon(R) Silver 4108 CPU @ 1.80GHz (32 x 1796)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 63.71GB (37.04GB free)
Process Argv --crash-reporter-id 2058db1e-f1e8-433e-bf38-476163c306a2
Screen Reader no
VM 0%
A/B Experiments
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

@bzorn bzorn added the bug Something isn't working label Jul 1, 2024
@bzorn
Copy link
Collaborator Author

bzorn commented Jul 1, 2024

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.

@pelikhan
Copy link
Member

pelikhan commented Jul 2, 2024

  • 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.

@pelikhan
Copy link
Member

pelikhan commented Jul 2, 2024

fixed in 1.42.3

@pelikhan pelikhan closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants