ffi-napi: An object was expected
See original GitHub issuePrerequisites
- Using yarn
- Using an up-to-date
masterbranch - Using latest version of devtools. Check the docs for how to update
- Tried solutions mentioned in #400
- For issue in production release, add devtools output of
DEBUG_PROD=true yarn build && yarn start
Expected Behavior
ffi-napi should work fine within packaged app
Current Behavior
I added ref-napi (https://github.com/node-ffi-napi/ref-napi) (v. 2.1.2) as a native dependency. It works ok when running the app locally (even prod build), but as soon as I try to run a packaged and installed version of the app (both Windows and MacOS), the error from screenshot get raised

Actually this line fails

Invocation of the require('node-gyp-build')(path.join(__dirname, '..')) gives me the error listed above.
Steps to Reproduce
-
Install ref-napi as a native dependency in the app directory
-
Import and use ref-napi somewhere in renderer, e.g., any React component
-
Run
yarn cross-env DEBUG_PROD=true yarn package -
Install app
-
Once the app launched, you can observe error in dev console
Context
Why: I’m using this package in conjunction with ffi-napi (https://github.com/node-ffi-napi/node-ffi-napi) to get access to the system’s libraries via FFI approach (C language) The main change: only added dotenv and utilized it in webpack configs
Your Environment
- Node version : v12.18.2
- electron-react-boilerplate version or branch : master
- Operating System and version : MacOS Catalina 10.15.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)

Top Related StackOverflow Question
changing the electron-rebuild script to work with --sequential instead of --parallel, solved the issue for me
tried this faced the same issue