Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
Electron Js Linux Built Not working when installed using snap

The code that I used to create desktop application is working locally. The app is about taking screen shot. When built using electron-builder it is building properly and creating AppImage and snap file for the app. Now my-app.AppImage file when open is working as expected. But the my-app.snap file when installed using snap is not running as expected. Below is the code in app.js

  ipcMain.on("start-share", function (event, arg) { 
    event.reply("uuid", "Screen Started"); // Not going further than this
    screenshot().then((img) => {
        try {
            event.reply("uuid", "Entered Screen Shot");
            let imgStr = Buffer.from(img).toString('base64');
            var obj = {};           
            obj.document_1 = imgStr;
            var url = 'http://some-url.com/api/workhub/test/task';
            axios.post(url, obj)
                .then((response) => {
                    // message = response.data;
                    event.reply("uuid", response.data);
                }).catch(error => {
                    event.reply("uuid", "Failed Catch Axios");
                }).finally(() => {

                });
        } catch (err) {
            event.reply("uuid", "Failed Try Catch Normal");
        }
    }).catch((err) => {
        event.reply("uuid", "Failed Catch Screen Shot");
    });
})

package.json file

  "name": "my-app",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "electron ."
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^0.27.2",    
    "screenshot-desktop": "^1.12.3"    
  },
  "devDependencies": {
    "electron": "^11.1.0"
  }
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda