You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Electron is the evolution of Atom Shell, which puts HTML5 into Desktops.
Understood there is some "post build" activities, like wiring up ipcRenderer to communicate with the main process but was hoping a default export of a rendered page would work. However: on v 1.3 of BRJS:
loading from a browserWindow.loadURL(url)
in bundle.js:
realm.install(); // Uncaught ReferenceError: realm is not defined
in module.js:
if (!filename) {
var err = new Error("Cannot find module '" + request + "'");
err.code = 'MODULE_NOT_FOUND';
throw err;
}
return filename;
the error being the module is not found.
It might be a challenge to support however:
Electron is based on Chromium at some level, and Chrome works just fine
As I understand you created a package.json and main.js which points to index.html. The problem is that index.html is a switcher rather than index.
You need to make a few quick changes in order to make it work.
Change your default-aspect/index.jsp to index.html. This also requires to remove any JSP lines from the file. This change is needed because Electron doesn't accept .jsx.
After making this change generate the app again.
Since Electron has in built 'require' and 'define' we don't need to re-import them. Change: if (typeof module !== 'undefined'){ to if (typeof module !== 'undefined' && !global.window) { in bundle.js. I have opened a pr for this issue, so it stops re-import when using Electron in the future.
Finally, instead of pointing it to index.html, direct it to en.html
Although the comments about index.jsp/jsx aren't appliable here, I did the change in bundle.js that you suggested. Loaded fine without issue, well spotted.
now it is:
var defaultRealm = new Realm(global.require || globalResolve);
if (typeof module !== 'undefined' && !global.window) {
// for node.js
module.exports = defaultRealm;
} else {
// for the browser
global.realm = defaultRealm;
}
Electron is the evolution of Atom Shell, which puts HTML5 into Desktops.
Understood there is some "post build" activities, like wiring up ipcRenderer to communicate with the main process but was hoping a default export of a rendered page would work. However: on v 1.3 of BRJS:
loading from a browserWindow.loadURL(url)
in bundle.js:
in module.js:
the error being the module is not found.
It might be a challenge to support however:
Net: hoping Electron is supported out of the box on BladeRunner! [PhoneGap integration is obviously next ;)]
The text was updated successfully, but these errors were encountered: