Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

135
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda