-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
“Module did not self-register” when page is reloaded #5522
Comments
It should be a bug. Will look to fix it soon. |
I can't reproduce this with a simple case and requiring 'ref'. Could you please provide a case? |
Sorry, I forgot to mention that I'm using the 32 bit version of NW.JS all modules are installed using Here's a simple case:
Here's my
EDIT: |
Looks like the error is related to the use of
in |
I can't reproduce this issue with the reporter's test case on Linux and nwjs-sdk-0.21.0. It works fine even if I put |
close until more information is provided. |
@rogerwang I have this issue with two windows and mixed-context enabled. Let's say the window we put in package.json is a loading window (some splash screen). From this loading page we open our main window where we require the 'ffi' module. It happens only with mixed-context enabled. Here is the case:
|
@rogerwang Is there any updates on this issue? |
CC @Christywl , please try with @KiresMA 's example. |
@KiresMA , I try your sample, but there is an error in my device(Windows 10 64bit).
The app starts, but an error occurs in the devtools console: I also try to reload the app, there is no "Module did not self-register". May be it's blocked by the above error. Do you have any ideas about this error? |
@Christywl "you said refresh the page, does it mean 'reload the app'?" - Yes, it does. I forgot to mention that after $npm install I'm rebuilding ffi and ref modules with: Also please try to use both NodeJS and NWjs ia32 architecture (like I did) or at least just check whether they are both x64. Here are my device params:
|
@KiresMA , thanks for your advice. It works well for me after rebuild Environments:
|
@Christywl Try to:
|
I reproduce this issue now. Press F5, not right-click to reload the app. |
It seems as if you can't re-require native modules (.node files) in Node.js. Can it be related to this? https://nodejs.org/dist/latest-v8.x/docs/api/modules.html#modules_require_cache I have the same problem, and worked around it for now by initializing the native module only in Node context, and then exposing it to the browser context via |
The first time I run my NW.js application the modules are loaded without errors (and works). If I refresh the page (CTRL+R, F5 or SHIFT+F5) I get the error:
Module did not self-register
. This only happens whenffi
orref
is required.In Electron it works without problems.
ffi
andref
were installed usingnpm install ffi
andnpm install ref
followed bynw-gyp rebuild --target=0.18.8 --arch=ia32
from each of the two foldersnode_modules/ffi
andnode_modules/ref
Any ideas?
Here's the full error output:
The text was updated successfully, but these errors were encountered: