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

Error: Cannot find module 'remote' #122

Open
andig opened this issue Aug 14, 2016 · 2 comments
Open

Error: Cannot find module 'remote' #122

andig opened this issue Aug 14, 2016 · 2 comments

Comments

@andig
Copy link

andig commented Aug 14, 2016

I'm using app.js and have added dev tools. In the console I'm getting Error: Cannot find module 'remote' in module.js 440. I have not changed the repo structure.

Any idea what might be the problem with finding remote?

@andig
Copy link
Author

andig commented Aug 14, 2016

It might be that with current versions of electron it should read something like this:

var remote = require('electron').remote;
var Menu = remote.Menu;
var MenuItem = remote.MenuItem;

@samuelyeshua
Copy link
Contributor

samuelyeshua commented Aug 14, 2016

But because you are making use of "remote" in the main process when it is made to be used in the application renderer side?

In Electron, GUI-related modules (such as dialog, menu etc.) are only available in the main process, not in the renderer process. In order to use them from the renderer process, the ipc module is necessary to send inter-process messages to the main process. With the remote module, you can invoke methods of the main process object without explicitly sending inter-process messages, similar to Java’s RMI.
--- Remote Docs

Ie these modules are not indexed to the "remote"

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

2 participants