-
Notifications
You must be signed in to change notification settings - Fork 36
Fails to build from source on Electron versions higher than 12 #242
Comments
I encounter the same problem in a different way. I have been trying to get atom watcher to work with Electron via Electron Forge. On a clean install of Ubuntu 20.04.3, I created an Electron Forge webpack starter app using I then installed atom watcher using I then added, to main.js, the sample code here. When I try to run it with
Node version: 16.11.0 On a different system, I have also tried Electron's native module installation instructions as spelled out here: https://www.electronjs.org/docs/tutorial/using-native-node-modules But none of them worked. Is there any way to use atom watcher with Electron? Thank you. |
@george-thomas-hill I am also using Electron Forge. Your issue is the same as mine. This module does not support Electron versions higher than 12 |
@smashwilson @lkashef Hi guys. This issue is starting to be a big problem as Electron versions keep increasing without any means for us to upgrade. I'm happy to help in any way I can though! |
@taratatach did you try something like: diff --git a/src/nan/functional_callback.cpp b/src/nan/functional_callback.cpp
index 37aa897..5732244 100644
--- a/src/nan/functional_callback.cpp
+++ b/src/nan/functional_callback.cpp
@@ -24,9 +24,12 @@ void _noop_callback_helper(const FunctionCallbackInfo<Value> & /*info*/)
void _fn_callback_helper(const FunctionCallbackInfo<Value> &info)
{
Local<ArrayBuffer> cb_array = info.Data().As<ArrayBuffer>();
- Contents cb_contents = cb_array->GetContents();
+#if (V8_MAJOR_VERSION >= 8)
+ auto *payload = static_cast<intptr_t *>(cb_array->GetBackingStore()->Data());
+#else
+ auto *payload = static_cast<intptr_t *>(cb_array->GetContents().Data());
+#endif
- auto *payload = static_cast<intptr_t *>(cb_contents.Data());
assert(cb_contents.ByteLength() == sizeof(FnCallback *));
auto *fn = reinterpret_cast<FnCallback *>(*payload);
diff --git a/src/worker/linux/cookie_jar.h b/src/worker/linux/cookie_jar.h
index 05d33a3..8c36879 100644
--- a/src/worker/linux/cookie_jar.h
+++ b/src/worker/linux/cookie_jar.h
@@ -17,7 +17,7 @@
class Cookie
{
public:
- Cookie(ChannelID channel_id, std::string &&from_path, EntryKind kind);
+ Cookie(ChannelID channel_id, std::string &&from_path, EntryKind kind) noexcept;
Cookie(Cookie &&other) noexcept;
~Cookie() = default;
|
@loqs your changes are not enough for the software to compile. There still are references to I did manage to get the software to compile but not for the tests to fully pass (and I get the same crashes when trying to use the resulting binary in my project). |
Description
@atom/watcher
fails to build with Electron versions higher than 12Steps to Reproduce
Expected behavior:
It builds
Actual behavior:
It doesn't
Reproduces how often:
Always
Versions
Node version: v16.7.0
npm version: v7.20.3
Windows 10 Home 2004 build 19041.928
Additional Information
https://docs.google.com/document/d/1sTc_jRL87Fu175Holm5SV0kajkseGl2r8ifGY76G35k/view
The text was updated successfully, but these errors were encountered: