WindmillWWindmill
Powered by
httpteapotH
Windmill•2y ago•
20 replies
httpteapot

Error when calling a bun script using `wmill.runScript`

I have a bun script, that uses
jsdom
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
jsdom
in
bun
bun
but it only occurs when calling a script using
wmill.runScript
wmill.runScript
and not when calling it directly.
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

wmill script generate-metadata Error: Failed to generate lockfile.
rubenfRrubenf / help
2y ago
Importing pgClient when using bun
KanaKKana / help
3y ago
Error while executing Bun script: missing sourcemaps
invakid404Iinvakid404 / help
2y ago
wmill sync push error
NaillikNNaillik / help
2y ago