question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`AppImage` does not start, misses dependency

See original GitHub issue

I wanted to create an AppImage from sveltekit-electron. Since I’m on Linux Mint, I changed the

In package.json, I changed the build:electron script entry:

"build:electron": "electron-builder -l --config build.config.json",

In build.config.json, I added

  "linux": {
      "target": "AppImage"
    },

After running pnpm run build, there’s an *.AppImage file in dist. When trying to run that file, an error is printed:

$ dist/Svelte\ Electron-0.0.1.AppImage
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'jsonfile'
Require stack:
- /tmp/.mount_SvelteKlfyNf/resources/app.asar/node_modules/electron-window-state/index.js
- /tmp/.mount_SvelteKlfyNf/resources/app.asar/src/electron.cjs
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
    at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128)
    at Module._load (internal/modules/cjs/loader.js:732:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/tmp/.mount_SvelteKlfyNf/resources/app.asar/node_modules/electron-window-state/index.js:5:18)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10)
    at Module.load (internal/modules/cjs/loader.js:935:32)

From there on, the process hangs without opening a window. Because it hangs, I was able to inspect the temporary directory and could confirm there is no module jsonfile to be found. I did unpack the resources/app.asar archive as well. In the unpacked *.asar, in file node_modules/electron-window-state/package.json there’s a dependency "jsonfile": "^4.0.0" so one should think the builder should pick this up.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Naratnacommented, Jul 29, 2022

I was able to successfully build the AppImage with pnpm by adding public-hoist-pattern=* to .npmrc, as pointed out in this issue

0reactions
ghostdevvcommented, Mar 15, 2022

Makes sense!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing dependency in AppImage: libgconf-2 #1305 - GitHub
Workaround: sudo apt install libgconf2-4 , then the AppImage will run. But it needs to be fixed inside the AppImage.
Read more >
Troubleshooting — appimage-builder 1.0.0 documentation
The first thing to check when Appimage is created is the .bundle.yml file. ... then too look for missing packages or undesired external...
Read more >
AppImage incompatibility in Ubuntu 22.04 - Joplin Forum
The AppImage distribution (and more generally, all existing AppImage's) are built expecting libfuse2 support. This means that AppImage's will not run on Ubuntu ......
Read more >
Appimage application does not find vulkan dependencies
I have an AMD GPU that supports vulkan and it's working fine for other applications but is not working for a particular appimage....
Read more >
Common Configuration - electron-builder
If you want to use js file, do not name it electron-builder.js . ... Boolean - Whether to rebuild native dependencies before starting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found