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

[Bug]: Upgrade to Electron 28 : error with canvas library using electron-forge start - macOS #3481

Closed
3 tasks done
jarnault opened this issue Feb 1, 2024 · 2 comments
Closed
3 tasks done

Comments

@jarnault
Copy link

jarnault commented Feb 1, 2024

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.2.0

Electron version

v28.2.0

Operating system

macOS Version 14.2.1 (23C71)

Last known working Electron Forge version

v27

Expected behavior

During the start:
Preparing native dependencies Success

Actual behavior

✖ Preparing native dependencies: 0 / 1
  › node-gyp failed to rebuild '***/node_modules/canvas'.
    For more information, rerun with the DEBUG environment variable set to "electron-rebuild".
    Error: `make` failed with exit code: 2

Steps to reproduce

Upgrade Electron from 27 to 28 and try to run electron-forge start

Additional information

I'm trying to upgrade from Electron 27 to Electron 28.
After that, compiling works fine (tsc -p src/electron --outDir dist)
But starting Electron app fails (using electron-forge start)
Versions:

  • Electron: ^v28.0.0
  • @electron-forge/* : 7.2.0
  • canvas: 2.11.2

Complete error

In file included from ../fsevents.cc:6:
../../../../nan/nan.h:2542:8: error: no matching member function for call to 'SetAccessor'
tpl->SetAccessor(
~~~~~^~~~~~~~~~~
/Users/tangsong/.electron-gyp/20.3.12/include/node/v8-template.h:814:8: note: candidate function not viable: no known conversion from 'imp::Sig' (aka 'int') to 'v8::SideEffectType' f…
void SetAccessor(
^
/Users/tangsong/.electron-gyp/20.3.12/include/node/v8-template.h:807:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8:…
void SetAccessor(
^
../fsevents.cc:14:10: fatal error: 'src/storage.cc' file not found
#include "src/storage.cc"
^~~~~~~~~~~~~~~~
3 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1
Error: `make` failed with exit code: 2
at ChildProcess.onExit (/Users/tangsong/Documents/cqq/sop/electron_pension/node_modules/node-gyp/lib/build.js:203:23)
at ChildProcess.emit (node:events:513:28)
at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)

An unhandled rejection has occurred inside Forge:
Error: node-gyp failed to rebuild '/private/var/folders/6c/44_3vj9n74sdtr04s4nndkr40000gp/T/electron-packager/tmp-kxHxeG/Electron.app/Contents/Resources/app/node_modules/watchpack-chokidar2/node_modules/fsevents'
at ChildProcess.<anonymous> (/Users/tangsong/Documents/cqq/sop/electron_pension/node_modules/@electron/rebuild/lib/module-type/node-gyp/node-gyp.js:118:24)
  at ChildProcess.emit (node:events:513:28)

### Steps to reproduce

make a    electron project 
"@electron-forge/cli": "^7.2.0",
  "@electron-forge/maker-deb": "^7.2.0",
  "@electron-forge/maker-rpm": "^7.2.0",
  "@electron-forge/maker-squirrel": "^7.2.0",
  "@electron-forge/maker-zip": "^7.2.0",
  "cross-env": "^7.0.3",
  "electron": "^28.1.4",
and use  electron-forge  to  make it



### Additional information

_No response_
@onurbilenlacin
Copy link

onurbilenlacin commented Feb 9, 2024

I have converted reactjs web application which is including canvas to desktop app using electron. I added electron forge to make package and publish ios and windows platforms. However I am getting same error while I start command npm run make;

 Error: `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.e…  

An unhandled rejection has occurred inside Forge:
Error: node-gyp failed to rebuild 'C:\Users\***\node_modules\canvas'
at ChildProcess.<anonymous> (C:\Users\onurl\OneDrive\Masaüstü\Electron\apitwist-book-desktop\node_modules\@electron\rebuild\lib\module-type\node-gyp\node-gyp.js:118:24)
    at ChildProcess.emit (node:events:526:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    ```

@erickzhao
Copy link
Member

Hey, I think this might be fixed in the latest version, ref electron/rebuild#1157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants