webview-bun icon indicating copy to clipboard operation
webview-bun copied to clipboard

ERR_DLOPEN_FAILED: Failed to open library. This is usually caused by a missing library or an invalid library path.

Open citkane opened this issue 1 year ago • 0 comments

Linux64 (Debian 12) Bun 1.1.22 webview-bun 2.1.0

Webview-bun crashes with the titled error.

A number of related issues have already been closed with no obvious remedy, and the root of the problem (for Debian based distros anyways), seems to be this issue with LD_LIBRARY_PATH.

I have worked around this for now:

  1. Locally building the webview binary for my specific environment.
  2. Copying the built libwebview.so into .../myApp/bin.
  3. Running myApp with WEBVIEW_PATH=bin/libwebview.so bun run src/myApp.ts.

My libview.so build is however likely to fail on a different linux environment of an end user...

I have tried to use the npm bundled webview binary by setting export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH (the spot for Debian 12), but this still fails. This leads me to suspect that the problem is in this repository's built binary, and that a "one binary fits all linux" situation is not true.

Maybe when webview-bun builds the linux binary at its lowest level, there is an option to pass export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/lib64/:$LD_LIBRARY_PATH?

citkane avatar Aug 13 '24 11:08 citkane