Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"affinity" has a bug #20047

Closed
wuwei2150 opened this issue Aug 30, 2019 · 6 comments
Closed

"affinity" has a bug #20047

wuwei2150 opened this issue Aug 30, 2019 · 6 comments

Comments

@wuwei2150
Copy link

wuwei2150 commented Aug 30, 2019

repro steps:
1.git pull "electron-quick-start"
2.modify source:
main.js:
function createWindow () {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
affinity: "main", //add
nodeIntegration :true
}
})

renderer.js
const ffi = require('ffi')
ffi.ffiType

3."electron ." run app
4.refresh page
5.have a error:
.D:\Project\electron-quick-start\node_modules\bindings\bindings.js:121 Uncaught Error: Module did not self-register.
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:166:20)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:740)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:166:20)
at Module.load (internal/modules/cjs/loader.js:620)
at tryModuleLoad (internal/modules/cjs/loader.js:559)
at Function.Module._load (internal/modules/cjs/loader.js:551)
at Module.require (internal/modules/cjs/loader.js:658)
at require (internal/modules/cjs/helpers.js:20)
at bindings (D:\Project\electron-quick-start\node_modules\bindings\bindings.js:112)
at Object. (D:\Project\electron-quick-start\node_modules\ref\lib\ref.js:5)

  1. i test version 3.1.13 4.2.10 5.0.10 6.0.6,all has this bug

  2. #electron-drag breaks when using 'affinity' kapetan/electron-drag#10 (comment)

@MarshallOfSound
Copy link
Member

You're loading a native module twice in the same process, this is why affinity is experimental and will be removed at some point in the future. You need to either stop using that native module or stop using affinity

@MarshallOfSound
Copy link
Member

GitHub issues are for feature requests and bug reports, questions about using Electron or code assistance requests should be directed to the community or to the Slack Channel.

@ThomasMoutel
Copy link

ThomasMoutel commented Sep 2, 2019

You're loading a native module twice in the same process, this is why affinity is experimental and will be removed at some point in the future. You need to either stop using that native module or stop using affinity

Sorry, but I'm having difficulties to see the direct link between having an experimental feature and having to remove it in the future. I sincerely hope that affinity is not the new PDF, in terms of feature deprecation.

@MarshallOfSound
Copy link
Member

@ThomasMoutel Please see #18397. The intention is to remove Affiny

@wuwei2150 wuwei2150 changed the title "affinity" have a bug "affinity" has a bug Sep 3, 2019
@kirilpopov
Copy link

kirilpopov commented Sep 25, 2019

@ThomasMoutel Please see #18397. The intention is to remove Affiny

How about all the apps that depend on affinity (try opening 100 windows without affinity) - this is basically a game over for them.

@jaehayoo
Copy link

jaehayoo commented May 3, 2020

Our application is opening 25~50 game windows.
This would not be possible without affinity.
Please consider keeping the affinity option with patching the bug.
Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants