tr1ckydev / webview-bun

Bun bindings for webview, a tiny library for creating web-based desktop GUIs.
https://www.npmjs.com/package/webview-bun
MIT License
247 stars 11 forks source link

(windows): ERR_DLOPEN_FAILED #5

Closed hjbdev closed 7 months ago

hjbdev commented 7 months ago
 src-backend  bun .\index.js
23 |     case "linux": lib_path += "libwebview.so"; break;
24 |     case "darwin": lib_path += `libwebview.${process.arch}.dylib`; break;
25 |     default: throw "unsupported platform: " + process.platform;
26 | }
27 |
28 | export const lib = dlopen(process.env.WEBVIEW_PATH ?? lib_path, {
                        ^
ERR_DLOPEN_FAILED: Failed to open library. This is usually caused by a missing library or an invalid library path.
 syscall: "dlopen"

      at bun:ffi:61:41
      at C:\Users\Harry\Dev\broadcast-kit-next\node_modules\webview-bun\src\ffi.ts:28:20

index.js just contains the basic example

I added a console.log to the lib_path variable in ffi.ts and it's pointing to the correct dll, so might be an issue with bun itself? I'm on bun 1.1.3.

tr1ckydev commented 7 months ago

It's not a issue with bun, but something i still haven't found yet. I do have a workout which is to clone repo and built the dll atleast once on the host system, but why does it work, I've yet to find out.

tr1ckydev commented 7 months ago

Fixed in latest commit.