-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
In a project I'm working on I use Sharp in the browser. Currently we are bundling with Vite. In trying to leverage Bun build I get this error
6 | const childProcess = require('child_process');
^
error: Browser build cannot require() Node.js builtin: "child_process". To use Node.js builtins, set target to 'node' or 'bun'
at /Users/eigilsagafos/Projects/bun-sharp-test/node_modules/detect-libc/lib/detect-libc.js:6:30
To reproduce:
index.ts
import sharp from "sharp";
sharp({});
Then run bun build index.ts --target=browser
I understand this is a problem with Bun as they are aiming for 100% Node compatibility, but it seems somewhat related to #27
(Sorry for all the edits. I created the issue by mistake before I was done π )
Metadata
Metadata
Assignees
Labels
No labels