get-windows: Crashes when running with Node v14.x or Electron v12.x
Windows 10
Electron v12.0.1
active-win v6.3.0 (same behavior with active-win v6.2.0)
While running with Electron v11.x everything works fine. But with v12 have next errors:
# Fatal error in , line 0
# ignored
#
#
#
#FailureMessage Object: 0000007D3B1FA9E0
1: 00007FF78B8F49FF node::OnFatalError+70575
2: 00007FF78C7769CA v8::FunctionTemplate::RemovePrototype+598138
3: 00007FF78A6BD37A v8::ArrayBuffer::GetBackingStore+922
4: 00007FF78A6BD03F v8::ArrayBuffer::GetBackingStore+95
5: 00007FF78BBAC499 napi_get_typedarray_info+425
6: 00007FFFA35FBF15 FFI::WrapPointer<_ffi_type>+213 [c:\abc\node_modules\ffi-napi\src\ffi.h]:L37
7: 00007FFFA3600576 FFI::FFI::InitializeBindings+4486 [c:\abc\node_modules\ffi-napi\src\ffi.cc]:L117
8: 00007FFFA35FF062 Init+82 [c:\abc\node_modules\ffi-napi\src\ffi.cc]:L304
9: 00007FFFA35FBE1F Napi::details::WrapCallback<<lambda_8c7377a71108815b2eee34f099f4cb99> >+63 [c:\abc\node_modules\ffi-napi\node_modules\node-addon-api\napi-inl.h]:L104
10: 00007FFFA35FA1A1 __napi_Init+81 [c:\abc\node_modules\ffi-napi\src\ffi.cc]:L309
11: 00007FF78B9DA793 node::PromiseRejectCallback+3843
12: 00007FF78B8D6825 node::binding::get_linked_module+2725
13: 00007FF78B8D582C node_module_register+2652
14: 00007FF78C224D31 v8::Object::SetLazyDataProperty+479777
15: 00007FF78C22477C v8::Object::SetLazyDataProperty+478316
16: 00007FF78C2244EB v8::Object::SetLazyDataProperty+477659
17: 00007FF78C2243A7 v8::Object::SetLazyDataProperty+477335
18: 00007FF78B5A589C v8_inspector::protocol::Binary::operator=+455164
### etc etc etc upt to 100 lines...
Possible because of Electron v12 started to use node v14.x. In Electron v11 it was node.js v12.x
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (4 by maintainers)
Just tried. On the Windows 10 with Electron 12 and active-win 7. The whole app crashes when I try to get activeWindow for the same window more than one time.
It shows me the next error
@liuzhengdong2
We are talking here about the crash when you try to get window info of the same window more than one time. Try to update your code to the:
Experiencing the same issue! If the current active window is the same as the previous active window, the script crashes. active-win@7.1.0, node v14.16.1, Windows 10 20H2 19042.870 (Did not use Electron or other npm dependencies. It’s a “fresh” project.)
Can confirm using
ref-struct-di
fixed it on node 14.7. @sindresorhus can I send a PR with this fix?Package
ref-napi
is incompatible withref-struct-napi
https://github.com/node-ffi-napi/ref-napi#incompatible-packages. I try to useref-struct-di
and seems it fixed crash on Electron 12 (win32)Experiencing the same here with Node 14.x and Electron 12.x. Did some local tests and the error happens when calling
user32.GetForegroundWindow();
a second time. Did another test without runningactive-win
butffi-napi
directly and had the same issue. This makes me believe that the problem is not related to this package but related to https://github.com/node-ffi-napi/node-ffi-napiwell, i encouter this problem too in this situation, sorry.