WindmillWWindmill
Powered by
NackiN
Windmillโ€ข7mo agoโ€ข
5 replies
Nacki

wmill sync not bundling relative imports

I have a "utils" class that has its own dependencies. I import this class in a "script".

I would expect this to be bundled when using "wmill sync push" as per the docs, but the script gets "--- BUN INSTALL ---

error: Failed to find relative import at ...."

In the VSCode plugin, I can observe the same error, but if I tick the "bundle relative paths for preview" box, the script works as expected, and the dependencies get bundled. If i run "bun build" on the script, I can also observe a correct and expected bundle being generated.

No matter what I do I cant get the dependencies to resolve outside of my own local "bun build" or the VSCode plugin with "bundle relative imports" enabled.

Am I wrong that using "wmill sync push" should build a bundle with dependencies included?

Ive experimented with different values in "includes" and "excludes". The dependency is a Prisma Client generated with ESM and if I dont have it in "excludes", "wmill sync push" generates 100's of scripts + yamls + lock files, one for each single individual file in the generated client and any dependency it has, that just doesnt seem right...? Is it the case that you need to create "scripts" for every single file that is a part of a relatively imported dependency tree? Some of my upcoming dependencies have 1000+ files, what is the intended workflow for relative imports?

I just want the script I push with "windmill sync push" to be the same as when I bundle locally with esbuild or the VSCode extension feature, is that not possible?

This line in the docs is very confusing at https://www.windmill.dev/docs/advanced/dependencies_in_typescript#bundle-per-script-built-by-cli:

"Windmill CLI, it is done automatically on wmill sync push for any script that falls in the patterns of includes and excludes as defined by the wmill.yaml (in the codebase field)."
I dont have any codebases, just my windmill code and scripts in same path, with stuff i want to import relateively across several scripts...
Dependencies in TypeScript | Windmill
In Windmill standard mode, dependencies in TypeScript are handled directly within their scripts without the need to manage separate dependency files.
WindmillJoin
3,362Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
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 sync resource deletion
hkaderHhkader / help
14mo ago
wmill sync push error
NaillikNNaillik / help
2y ago
wmill cli sync error
SindreSSindre / help
3y ago
wmill sync pull does not sync plain files as documented
Julian @ 42 N.E.R.D.S.JJulian @ 42 N.E.R.D.S. / help
16mo ago