Closed timebuzzerfelix closed 2 years ago
@timebuzzerfelix, what nodejs and package versions are you using?
Try running:
npm install -g npm
npm rebuild
rm -rf node_modules
npm install
I get the same thing, the reason is here: https://github.com/Seo-Rii/electron-acrylic-window/commit/1385c074533bf43ca885463677ea37a366aa4575#diff-0d6aa7470314ca774fd7e07f67b35ecd3045fe5cb3a0e5c99f48bae897905d32
We don't include any source file for any platform other than windows, but we still import the bindings. To fix this error one must always return an NODE_API_MODULE
init function.
The change linked above obviously fixed something, so maybe we can define another file for "rest" which just calls an empty init function so things will work. Or better yet; conditionally import the bindings. I know that doesn't play nice with the import syntax though.
Same here, any fixes yet?
I can't reproduce since I'm on Windows. I agree this is an issue, but for now, a workaround could be to only require the module if the platform is win32.
if (os.platform === 'win32') {
const { setVibrancy } = require('electron-acrylic-window');
setVibrancy(...)
}
I can't reproduce since I'm on Windows.
Me too, but I use VirtualBox to test my program, maybe you can consider it too.
I agree this is an issue, but for now, a workaround could be to only require the module if the platform is win32.
if (os.platform === 'win32') { const { setVibrancy } = require('electron-acrylic-window'); setVibrancy(...) }
Not only the
setVibrancy
function tho but importing theBrowserWindow
also causing errors.
I have the same problem on M1 Mac... Ist there a fix/workaround?
I wrote a workaround for this a while ago and I just realized it may have been misunderstood. If the setVibrancy
function is called, the BrowserWindow
from electron-acrylic-window is not required. Instead the normal BrowserWindow
from electron should be used.
Sorry for my late response, I have been quite busy lately. I self assigned the issue in September, but due to this bug, I was unable to build. I will try to debug the cause of the bug, and in the meantime I hope this workaround can help.
const { BrowserWindow } = require('electron');
const os = require('os');
if (os.platform === 'win32') {
const { setVibrancy } = require('electron-acrylic-window');
setVibrancy(...);
}
Sorry, I got confused and forgot what the problem was. I'll do a push request soon...
On Windows: Building the App and all functions work properly On Mac & Linux it throws "Error: Module did not self-register." I already tried rebuild the module, rebuild all modules, delete all node modules and yarn again, nothing helped
Any idea what could help?
Here's the complete Error:
Error: Module did not self-register. at process.func [as dlopen] (electron/js2c/asar.js:140:31) at Object.Module._extensions..node (internal/modules/cjs/loader.js:1016:18) at Object.func [as .node] (electron/js2c/asar.js:140:31) at Module.load (internal/modules/cjs/loader.js:816:32) at Module._load (internal/modules/cjs/loader.js:728:14) at Function.Module._load (electron/js2c/asar.js:748:26) at Module.require (internal/modules/cjs/loader.js:853:19) at require (internal/modules/cjs/helpers.js:74:18) at bindings (/Users/dev/Documents/GIT/ ... /node_modules/bindings/bindings.js:112:48) at Object. (/Users/dev/Documents/GIT/ ... /node_modules/electron-acrylic-window/build_ts/bindings.js:3:36)
at Module._compile (internal/modules/cjs/loader.js:968:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Module._load (internal/modules/cjs/loader.js:728:14)
at Function.Module._load (electron/js2c/asar.js:748:26)
at Module.require (internal/modules/cjs/loader.js:853:19)