mksnapshot: snapshotResult is not defined with Electron 11

Hi, I tried implementing v8 snapshots with Electron 11 on Apple Silicon devices.

The snapshot_blob.bin is successfully created, and I then move it to the node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron\ Framework.framework/Resources folder.

But when starting the app, I got an error telling me that snapshotResult was not defined. I followed this blog post, which was using Electron 9, which I can’t use if I want to support natively Apple Silicon devices.

Do you have already tried on a similar setup, or do you have any idea on how to fix this? Thanks in advance.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 27 (8 by maintainers)

Most upvoted comments

It worked!!! Thanks so much @jkleinsc

Screen Shot 2021-05-27 at 10 58 36

@QuiiBz I have been doing some testing and while I can’t yet 100% verify this, it appears that our testing builds for arm64/m1 macs work properly with snapshots, but release builds (eg the ones that are in npm) seem to have problems with snapshots. Once I do some additional testing I’ll reply in this issue with an update.

Any update? @jkleinsc

Same here. While it downloads the compatible base snapshot (#36), the generated snapshot blob seems to be not working. What do you think? @jkleinsc

I found the issue. It will require new releases of Electron as well as new versions of this module. I should have a fix up shortly.

Unfortunately, no. I’ve tried to generate without using electron-link but I couldn’t get theAnswer constant in the snapshot.