httpteapot
httpteapot
WWindmill
Created by httpteapot on 9/19/2024 in #help
Cannot paste text in Windmill preview in VSCode
+V is not working in the preview panel of VSCode using the Windmill extension.
12 replies
WWindmill
Created by httpteapot on 9/17/2024 in #help
Error when calling a bun script using `wmill.runScript`
I have a bun script, that uses jsdom as a dependency. The script is working as expected when calling it directly through the windmill cloud UI. But now I try to create a second script, written in TS, and call the first script using
import * as wmill from "windmill-client"

export async function main() {
return await wmill.runScript('f/phones/myfirstscript', null, { pageToScrap: "https://example.com"})
}
import * as wmill from "windmill-client"

export async function main() {
return await wmill.runScript('f/phones/myfirstscript', null, { pageToScrap: "https://example.com"})
}
And this time I get the following error:
Error: Job 0192002f-4ee9-00ad-7389-62022edcd325 was not successful: {"name":"ExecutionErr","message":"ExitCode: 1, last log lines:\njob=0192002f-4ee9-00ad-7389-62022edcd325 tag=bun worker=wk-default-cj8jl-BuC5V hostname=windmill-workers-7f68684c68-cj8jl\n\nloaded bin/bundle from object store /tmp/windmill/cache/bun/9d943d25e4998b10a15907558fdc194673bf0d25764692290d7df612dabbd1bd in 115ms\n\n--- BUN BUNDLE SNAPSHOT EXECUTION ---\n\nerror: Cannot find module \"/tmp/windmill/wk-default-ncp74-Ke4NK/0192002e-bc76-62ce-853a-3f8a961048ff/node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js\" from \"/tmp/bun/main.js\"\n\nBun v1.1.27 (Linux arm64)"}
Error: Job 0192002f-4ee9-00ad-7389-62022edcd325 was not successful: {"name":"ExecutionErr","message":"ExitCode: 1, last log lines:\njob=0192002f-4ee9-00ad-7389-62022edcd325 tag=bun worker=wk-default-cj8jl-BuC5V hostname=windmill-workers-7f68684c68-cj8jl\n\nloaded bin/bundle from object store /tmp/windmill/cache/bun/9d943d25e4998b10a15907558fdc194673bf0d25764692290d7df612dabbd1bd in 115ms\n\n--- BUN BUNDLE SNAPSHOT EXECUTION ---\n\nerror: Cannot find module \"/tmp/windmill/wk-default-ncp74-Ke4NK/0192002e-bc76-62ce-853a-3f8a961048ff/node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js\" from \"/tmp/bun/main.js\"\n\nBun v1.1.27 (Linux arm64)"}
It seems related to the usage of jsdom in bun but it only occurs when calling a script using wmill.runScript and not when calling it directly.
21 replies