Skip to content

EBADF: bad file descriptor, write (windows + electron + node) #100

@semireg

Description

@semireg

I am seeing an error from a few of my Windows customers (electron app). The wasm-vips 0.0.13 minified code is hard for me to follow, it looks like the emscripten loader.

EBADF: bad file descriptor, write
    at Object.writeSync (node:fs:934:3)
    at ua (C:\Program Files\MYAPP\resources\app.asar\node_modules\wasm-vips\lib\vips-node.js:10:327)
    at a.onerror (C:\Program Files\MYAPP\resources\app.asar\node_modules\wasm-vips\lib\vips-node.js:29:110)
    at Worker.<anonymous> (C:\Program Files\MYAPP\resources\app.asar\node_modules\wasm-vips\lib\vips-node.js:29:255)
    at Worker.emit (node:events:513:28)
    at [kOnErrorMessage] (node:internal/worker:299:10)
    at [kOnMessage] (node:internal/worker:310:37)
    at MessagePort.<anonymous> (node:internal/worker:211:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:737:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)

Electron: 26.6.9
Node: v18.16

Import and basic usage is:

import Vips from 'wasm-vips';
...
let vipsInstance: Awaited<ReturnType<typeof Vips>> | undefined;
async function getVips() {
  if (!vipsInstance) {
    vipsInstance = await Vips();
  }
  return vipsInstance;
}

Strangely, I'm not able to reproduce on macOS or on my Windows VM. One user report is from Windows 11 Home.

Is there anything I can do to help the maintainers troubleshoot this issue? I'm sorry I don't have more info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions