MultiboxLabs/flow-browser

Run errors in ArchLinux about sharp

Closed this issue · 32 comments

Describe the bug
I've ported the package to ArchLinux AUR: flow-browser-bin
When I update it to 0.6.2, I got errors when I run the program:

$ /usr/bin/flow-browser 
App threw an error during load
Error: Could not load the "sharp" module using the linux-x64 runtime
ERR_DLOPEN_FAILED: libvips-cpp.so.8.16.1: 无法打开共享目标文件: 没有那个文件或目录
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/usr/lib/flow-browser/app.asar/node_modules/sharp/lib/sharp.js:121:9)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1715:10)
    at Module.load (node:internal/modules/cjs/loader:1296:32)
    at Module._load (node:internal/modules/cjs/loader:1115:12)
    at c._load (node:electron/js2c/node_init:2:17950)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:227:24)
    at Module.require (node:internal/modules/cjs/loader:1318:12)
    at require (node:internal/modules/helpers:136:16)

To Reproduce
Just run the app.

Device Information:

  • OS: EndeavourOS
  • App Version: 0.6.2
  • libvips Version: 8.16.1-2
  • DE: KDE Plasma 6.3.4

Run the original packaged app, I've got errors too:

$ ./flow-browser 
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Could not load the "sharp" module using the linux-x64 runtime
ERR_DLOPEN_FAILED: libvips-cpp.so.8.16.1: 无法打开共享目标文件: 没有那个文件或目录
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/home/zxp-endeavouros/.cache/paru/clone/flow-browser-bin/src/opt/Flow/resources/app.asar/node_modules/sharp/lib/sharp.js:121:9)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1715:10)
    at Module.load (node:internal/modules/cjs/loader:1296:32)
    at Module._load (node:internal/modules/cjs/loader:1115:12)
    at c._load (node:electron/js2c/node_init:2:17950)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:227:24)
    at Module.require (node:internal/modules/cjs/loader:1318:12)
    at require (node:internal/modules/helpers:136:16)

are you on arm or x64? @zxp19821005

are you on arm or x64? @zxp19821005

x86_64

The latest version 0.6.3 still have the problem.

any ideas how to fix? i don't use linux, so im not too sure.

version 0.5.0 run well. I will try to create a new package named flow-browser-git to try it later.

version 0.5.0 run well

v0.5.0 uses electron-forge rather than electron-builder, which is probably why.

I've create a new package named flow-browser-git,run with no libvips errors now, but got new errors.
When I type baidu in the address bar, I got these errors:

$ /usr/bin/flow-browser
[INITIALIZATION] gotTheLock true
--- Flow Browser ---
Production Build (0.6.4)

[INITIALIZATION] browser object created
[INITIALIZATION] second instance handler initialized
[INITIALIZATION] grabbing hasCompletedOnboarding()
(node:449287) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `electron35 --trace-deprecation ...` to show where the warning was created)
[PROFILES] Profile main already exists
APPIMAGE env is not defined, current application is not an AppImage
[INITIALIZATION] grabbed hasCompletedOnboarding() true
[INITIALIZATION] show browser window
Error while flushing PostHog PostHogFetchNetworkError: Network error while fetching PostHog
    at retriable (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2774:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async retriable (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:1572:25)
    at async PostHog.fetchWithRetry (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2764:16)
    at async PostHog._flush (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2731:17) {
  error: TypeError: fetch failed
      at node:internal/deps/undici/undici:13502:13
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async retriable (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2767:23)
      at async retriable (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:1572:25)
      at async PostHog.fetchWithRetry (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2764:16)
      at async PostHog._flush (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2731:17) {
    [cause]: Error: Client network socket disconnected before secure TLS connection was established
        at TLSSocket.onConnectEnd (node:_tls_wrap:1732:19)
        at TLSSocket.emit (node:events:530:35)
        at endReadableNT (node:internal/streams/readable:1698:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
      code: 'ECONNRESET',
      path: undefined,
      host: 'eu.i.posthog.com',
      port: 443,
      localAddress: null
    }
  },
  [cause]: TypeError: fetch failed
      at node:internal/deps/undici/undici:13502:13
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async retriable (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2767:23)
      at async retriable (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:1572:25)
      at async PostHog.fetchWithRetry (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2764:16)
      at async PostHog._flush (/usr/lib/flow-browser/app.asar/node_modules/posthog-node/lib/node/index.cjs:2731:17) {
    [cause]: Error: Client network socket disconnected before secure TLS connection was established
        at TLSSocket.onConnectEnd (node:_tls_wrap:1732:19)
        at TLSSocket.emit (node:events:530:35)
        at endReadableNT (node:internal/streams/readable:1698:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
      code: 'ECONNRESET',
      path: undefined,
      host: 'eu.i.posthog.com',
      port: 443,
      localAddress: null
    }
  }
}

Maybe the network problem?
And another problem was I can't drag the window.

weird... did you somehow block posthog from your network?

No, I havn't. I'm in China, maybe because of the GFW ~

I see. But that shouldn't stop the app from running successfully.

For dragging, GitHub uses the -webkit-app-region css to make it work, which might not work as well on Linux.

.app-drag {
-webkit-app-region: drag;
}
.remove-app-drag {
-webkit-app-region: no-drag;
}

Able to reproduce with the binary on 0.6.4, Arch Linux

reproduced the error on 0.7.0

terminal optput:

08:42:36 vwinter@lenowo Downloads → ./flow-browser-0.7.0.AppImage 
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Could not load the "sharp" module using the linux-x64 runtime
ERR_DLOPEN_FAILED: libvips-cpp.so.8.16.1: cannot open shared object file: No such file or directory
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/tmp/.mount_flow-btst6cf/resources/app.asar/node_modules/sharp/lib/sharp.js:121:9)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1715:10)
    at Module.load (node:internal/modules/cjs/loader:1296:32)
    at Module._load (node:internal/modules/cjs/loader:1115:12)
    at c._load (node:electron/js2c/node_init:2:17950)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:227:24)
    at Module.require (node:internal/modules/cjs/loader:1318:12)
    at require (node:internal/modules/helpers:136:16)

OS: ArchLinux
Kernel: Linux 6.14.4-zen1-2-zen
DE: KDE Plasma 6.3.5

Sketchy fix for this issue (do at your own risk)

sudo pacman -S libvips
sudo ln -s /usr/lib/libvips-cpp.so.42 /usr/lib/libvips-cpp.so.8.16.1

This isn't a fix -- symlinking versioned libraries can completely mess your system when upgrading if those deps change at all (it's happened to me multiple times)

This isn't a fix -- symlinking versioned libraries can completely mess your system when upgrading if those deps change at all (it's happened to me multiple times)

completely agree, but it’s a good start!

It's not a good start if you're putting your system at risk of breakage :/

It's not a good start if you're putting your system at risk of breakage :/

no, i meant it’s a good start to identify where the issue is occurring.

@ThatOneCalculator @virtualWinter Maybe you can try the git version.

The new errors on flow-browser-git

> tsc --noEmit -p tsconfig.node.json --composite false

src/main/browser/browser.ts:3:15 - error TS2305: Module '"electron"' has no exported member 'components'.

3 import { app, components, WebContents } from "electron";
                ~~~~~~~~~~


Found 1 error in src/main/browser/browser.ts:3

The new errors on flow-browser-git

> tsc --noEmit -p tsconfig.node.json --composite false

src/main/browser/browser.ts:3:15 - error TS2305: Module '"electron"' has no exported member 'components'.

3 import { app, components, WebContents } from "electron";
                ~~~~~~~~~~


Found 1 error in src/main/browser/browser.ts:3

had the same issue so i cloned the repo and built it myself and still had the lib problem

This isn't a fix -- symlinking versioned libraries can completely mess your system when upgrading if those deps change at all (it's happened to me multiple times)

i did mention the fact that its a "sketchy fix"

The new errors

hey, you used bun to install the packages? shouldn't have the problem.
we're using a forked version of electron in order to support widevine.

The new errors

hey, you used bun to install the packages? shouldn't have the problem. we're using a forked version of electron in order to support widevine.

I've changed to use bun, but still got the same errors.

$ bun run typecheck && electron-vite build
$ bun run typecheck:node && bun run typecheck:web
$ tsc --noEmit -p tsconfig.node.json --composite false
src/main/browser/browser.ts:3:15 - error TS2305: Module '"electron"' has no exported member 'components'.

3 import { app, components, WebContents } from "electron";
                ~~~~~~~~~~


Found 1 error in src/main/browser/browser.ts:3

==> 错误: 在 build() 中发生一个错误。
    正在放弃...

And note that, package.json still use npm

Bun doesn't support Electron yet.

Bun doesn't support Electron yet.

We use bun as a package manager, not to run the electron app.

Able to replicate on Arch too:

❯ ./flow-browser-0.7.0.AppImage
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Could not load the "sharp" module using the linux-x64 runtime
ERR_DLOPEN_FAILED: libvips-cpp.so.8.16.1: cannot open shared object file: No such file or directory
Possible solutions:

  • Ensure optional dependencies can be installed:
    npm install --include=optional sharp
  • Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
  • Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
  • Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object. (/tmp/.mount_flow-b7MHnzF/resources/app.asar/node_modules/sharp/lib/sharp.js:121:9)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1715:10)
    at Module.load (node:internal/modules/cjs/loader:1296:32)
    at Module._load (node:internal/modules/cjs/loader:1115:12)
    at c._load (node:electron/js2c/node_init:2:17950)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:227:24)
    at Module.require (node:internal/modules/cjs/loader:1318:12)
    at require (node:internal/modules/helpers:136:16)
    [456547:0515/022109.046763:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
    [456547:0515/022109.047008:ERROR:file_dialog_linux_portal.cc(78)] Failed to read portal version property
    ^C%

Well I am getting the same error in linux mint 22.1. Nothing happens if i run the gui app, but on running it though cli i get the same error.

A JavaScript error occurred in the main process
Uncaught Exception:
Error: Could not load the "sharp" module using the linux-x64 runtime
ERR_DLOPEN_FAILED: libvips-cpp.so.8.16.1: cannot open shared object file: No such file or directory
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/opt/Flow/resources/app.asar/node_modules/sharp/lib/sharp.js:121:9)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1715:10)
    at Module.load (node:internal/modules/cjs/loader:1296:32)
    at Module._load (node:internal/modules/cjs/loader:1115:12)
    at c._load (node:electron/js2c/node_init:2:17950)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:227:24)
    at Module.require (node:internal/modules/cjs/loader:1318:12)
    at require (node:internal/modules/helpers:136:16)

can anyone help me test the linux build on here?
#52 (comment)

can anyone help me test the linux build on here? #52 (comment)

Yes working, however i installed the .deb package, I would also be trying others and let you know. However this is linux mint, I hope other distros would work as well.

Image

can anyone help me test the linux build on here? #52 (comment)

Yes working, however i installed the .deb package, I would also be trying others and let you know. However this is linux mint, I hope other distros would work as well.

Image

For some reason appimage did not work, it can be error from my side. But flathub worked!

fixed in #52 🎉