Nick KadutskyiN
Windmill9mo ago
2 replies
Nick Kadutskyi

Can test/run but can't deploy (issue with sub-dependencies) [resolved]

I am getting this error:
Error deploying this script
This script has not been deployed successfully because of the following errors:
job=01964ffd-6b1e-c4d6-8107-a66ecf4f3166 tag=bun worker=wk-default-bb951e044087-Jq0yF hostname=bb951e044087

bun install v1.2.4 (fd9a5ea6)
Resolving dependencies
Resolved, downloaded and extracted [2]
Saved lockfile
+ pdfjs-dist-legacy@1.0.1
+ windmill-client@1.483.1
4 packages installed [417.00ms]
14767 |     const Canvas = require("canvas");
                                   ^
error: Could not resolve: "canvas". Maybe you need to "bun install"?
    at /tmp/windmill/wk-default-bb951e044087-Jq0yF/01964ffd-6b1e-c4d6-8107-a66ecf4f3166/node_modules/pdfjs-dist-legacy/pdf.js:14767:28

Bun v1.2.4 (Linux x64 baseline)
Non-zero exit status for bun build: 1


Here is a top of my script for dependencies:
import * as wmill from "windmill-client";
import {getDocument, version} from "pdfjs-dist-legacy";
import type { DocumentInitParameters } from 'pdfjs-dist/types/src/display/api';


The goal of the script is to get pdf file and output it as a text, so I use pdf.js only to parse pdf.

If in the script I add require("canvas") anywhere it deploys but it doesn't run.

Aslo, it seems like even thought it says it didn't deploy I still can run the script.

How to deal with that canvas dependencies in this case?
CleanShot_2025-04-19_at_14.50.452x.png
Was this page helpful?