Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use inside electron - Throws error on application start #505

Closed
cstayyab opened this issue Dec 30, 2020 · 3 comments
Closed

Cannot use inside electron - Throws error on application start #505

cstayyab opened this issue Dec 30, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@cstayyab
Copy link

cstayyab commented Dec 30, 2020

Bug description

When imported in an electron application, the application does not start.

Here is the error message displayed:

> walc@0.1.11 start /home/cstayyab/Development/cstayyab/WALC
> electron .

**
GLib-GObject:ERROR:../gobject/gvaluetypes.c:454:_g_value_types_init: assertion failed: (type == G_TYPE_CHAR)
Bail out! GLib-GObject:ERROR:../gobject/gvaluetypes.c:454:_g_value_types_init: assertion failed: (type == G_TYPE_CHAR)
/home/cstayyab/Development/cstayyab/WALC/node_modules/electron/dist/electron exited with signal SIGABRT
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! walc@0.1.11 start: `electron .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the walc@0.1.11 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cstayyab/.npm/_logs/2020-12-30T10_12_49_820Z-debug.log

Reproduction steps

Steps to reproduce the behavior:

  1. Create a new Electron Application
  2. Run it to test and it will successfully run
  3. Now close the app and add whatsapp-web.js using npm
  4. Import it to app using require.
  5. Try running the app again

Expected behavior

the app should start.

Relevant code

const { Client } = require('whatsapp-web.js');

The above line causes the issue

Environment (please complete the following information):

WhatsApp
Not Applicable because it doesn't even get to that part

Library

  • Browser [Chrome / Chromium]: Chrome/71.0.3578.80
  • NodeJS version (node -v): v12.16.1
  • npm or yarn version (npm -v): 6.13.4
  • whatsapp-web.js version: 1.12.0

Additional context

The problem has something to do with sharp and libvips. Here is a related issue. lovell/sharp#2356

@cstayyab cstayyab added the bug Something isn't working label Dec 30, 2020
cstayyab added a commit to cstayyab/whatsapp-web.js that referenced this issue Dec 30, 2020
Updating sharp and install libvips with it seems to resolve the issue it is having with electron. Fix pedroslopez#505
@andirsun
Copy link

andirsun commented Jan 4, 2021

Im facing the same error with electron.

@rudieros
Copy link

rudieros commented Feb 3, 2021

what version of electron are you guys using?
I'm doing fine with this config:
node 12.7.0
electron 11.2.1
whatsapp-web.js 1.12.1

@PurpShell
Copy link
Sponsor Collaborator

see my reply in #508

Closing this issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants