electron-userland / electron-prebuilt-compile Goto Github PK
View Code? Open in Web Editor NEWelectron-prebuilt with Babel and React built-in
electron-prebuilt with Babel and React built-in
Hey there,
thanks for your great work!
If run into a strange issue:
Electron starts up, also the browser window opens up (menu bar is visible), but nothing gets rendered or executed from the HTML file. Also the dev console does not show up.
I have the following setup:
HW: Raspberry Pi 3
OS: Raspbian Stretch Lite + xserver-xorg (and some dependencies)
I start electron with startx
.
As the main.js
works fine and there's no dev console, I can't even see error messages.
I did some tests, maybe they can help:
electron | electron-prebuilt-compile | works? |
---|---|---|
v1.4.1 | v1.4.1 | works |
v1.7.2 | v1.7.2 | works |
v1.7.13 | v1.7.13 | works |
v1.4.1 | v1.8.4 | nope |
v1.7.2 | v1.8.4 | nope |
v1.8.4 | v1.8.4 | nope |
v1.8.4 | v1.4.3 | works, but getting module version mismatch |
v1.8.4 | v1.7.0 | works, but getting module version mismatch |
v1.8.4 | v1.7.13 | works, but getting module version mismatch |
The module version mismatches are most likely a electron-rebuild
issue I think.
I just realised the issue was related to electron-forge, so it would be better to post it to electron-forge issues.
I noticed some things that seem wrong/weird to me:
package.json
to use "electron-prebuilt-compile": "1.7.10"
then npm install
I get npm ERR! notarget No matching version found for [email protected]
"electron-prebuilt-compile": "1.7.9"
it appears to actually use 1.7.10. That is, requireNode('process').versions.electron
returns "1.7.10" (I am using ember-electron
so requireNode
is basically just a wrapper for nodejs' require
)Was there some kind of release clobbering or am I missing something?
After switching from electron
to electron-prebuilt-compile
the name (or productName) in package.json
is not used for creating or reading from the folder in ~/.config/name
, but it instead defaults to the Electron name.
https://electron.atom.io/docs/api/app/#appgetname
Any ideas why this occurs? I've tried digging through the source code but so far I'm drawing a blank.
Edit: However, running the application packaged (using electron-builder) uses the correct name from package.json.
Seeing this error trying to use electron-forge with an es6 app, see related issue: electron/forge#441
It works for my colleague on his linux machine but not on my machine. This is the repo in question: https://github.com/digidem/mapfilter-desktop
Why does this error get called and how can we fix it? There is a package.json in the repo.
$ DEBUG=electron-forge:* npm start
> [email protected] start /Users/karissa/node_modules/mapfilter-desktop
> electron-forge start
WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle
electron-forge:lifecycle Process Started: Checking your system +0ms
electron-forge:lifecycle Process Succeeded: Checking your system +284ms
electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle
electron-forge:lifecycle Process Started: Locating Application +0ms
electron-forge:project-resolver searching for project in: /Users/karissa/node_modules/mapfilter-desktop +0ms
electron-forge:project-resolver electron-forge compatible package.json found in /Users/karissa/node_modules/mapfilter-desktop/package.json +5ms
electron-forge:lifecycle Process Succeeded: Locating Application +6ms
electron-forge:lifecycle Process Started: Preparing native dependencies +5ms
electron-forge:lifecycle Process Succeeded: Preparing native dependencies +442ms
electron-forge:hook could not find hook: generateAssets +0ms
electron-forge:lifecycle Process Started: Launching Application +2ms
electron-forge:lifecycle Process Succeeded: Launching Application +4ms
App threw an error during load
Error: Can't find package.json
at findPackageJson (/Users/karissa/node_modules/mapfilter-desktop/node_modules/electron-prebuilt-compile/lib/es6-init.js:19:11)
at findPackageJson (/Users/karissa/node_modules/mapfilter-desktop/node_modules/electron-prebuilt-compile/lib/es6-init.js:29:10)
at findPackageJson (/Users/karissa/node_modules/mapfilter-desktop/node_modules/electron-prebuilt-compile/lib/es6-init.js:29:10)
at findPackageJson (/Users/karissa/node_modules/mapfilter-desktop/node_modules/electron-prebuilt-compile/lib/es6-init.js:29:10)
at findPackageJson (/Users/karissa/node_modules/mapfilter-desktop/node_modules/electron-prebuilt-compile/lib/es6-init.js:29:10)
at main (/Users/karissa/node_modules/mapfilter-desktop/node_modules/electron-prebuilt-compile/lib/es6-init.js:44:23)
at Object.<anonymous> (/Users/karissa/node_modules/mapfilter-desktop/node_modules/electron-prebuilt-compile/lib/es6-init.js:59:1)
at Object.<anonymous> (/Users/karissa/node_modules/mapfilter-desktop/node_modules/electron-prebuilt-compile/lib/es6-init.js:61:3)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
^C```
npm start with:
"scripts": {
"start": "electron ."
},
...hangs, does nothing.
Got the tip from a presentation video on Youtube. I currently see no documentation how to use electron-prebuild-compile. The info on the front-page is somehow missleading, since it don't work as expected in any case.
Win 7 + node 6.x
Is this supposed to be a drop in replacement for electron-prebuilt?
I am running './node_modules/bin/electron' and getting:
App threw an error during load
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.resolve (path.js:1148:7)
at main (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/electron-prebuilt-compile/lib/es6-init.js:31:35)
at Object.<anonymous> (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/electron-prebuilt-compile/lib/es6-init.js:41:1)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at loadApplicationPackage (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/electron-prebuilt-compile/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js:288:12)
Running './node_modules/.bin/electron index.js' I get:
App threw an error during load
Error: Couldn't find preset "stage-0" relative to directory "/Users/timshnaider/Desktop/Development/electron/splitter-test"
at /Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:299:19
at Array.map (native)
at OptionManager.resolvePresets (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:270:20)
at OptionManager.mergePresets (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:10)
at OptionManager.mergeOptions (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:244:14)
at OptionManager.init (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:12)
at File.initOptions (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/babel-core/lib/transformation/file/index.js:216:65)
at new File (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/babel-core/lib/transformation/file/index.js:139:24)
at Pipeline.transform (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at BabelCompiler.compileSync (/Users/timshnaider/Desktop/Development/electron/splitter-test/node_modules/electron-compilers/lib/js/babel.js:129:19)
It would be nice to be able to use the latest 2.x (2.0.10 at the time of writing) as currently the newest on npm
is 2.0.7
, which does not include the fix for CVE-2018-15685 that was added in 2.0.8
Let's make it so every time a new version of electron
is published, this module updates itself with little or no human intervention.
@paulcbetts what does the current release process look like?
I had my main
entry in package.json
pointing at a file in the same folder as package.json
, which was preventing any transpilation from going on. Running electron .
would work perfectly fine, but doing a build using electron-packager-compile
resulted in the following error:
Moving it into a sub-directory suddenly made everything work.
Thanks for supporting the new 1.7.11 release. Would you mind also adding 1.8.2-beta.4?
https://github.com/electron/electron/releases/tag/v1.8.2-beta.4
Hello, the last commit "Publish 1.8.0" updates package version to 1.8.0 but electron dependency is still 1.6.13.
Should not be both 1.8.0 ?
In the package.json, electron version 1.3.11 is listed as a dependency, which results in error when trying to install since there is no version 1.3.11 of electron. The commit was made 21 hours ago, so I assume it was just a blunder.
I have tried installing electron 1.3.11 by its' own, without this library, and it results in the same error which means that there is no electron 1.3.11
App threw an error during load
TypeError: _fs2.default.statSyncNoException is not a function
at findPackageJson (C:\Users\xxxx\AppData\Roaming\npm\node_modules\electron-prebuilt-compile\lib\es6-init.js:25:20)
at main (C:\Users\xxxx\AppData\Roaming\npm\node_modules\electron-prebuilt-compile\lib\es6-init.js:44:23)
at Object. (C:\Users\xxxx\AppData\Roaming\npm\node_modules\electron-prebuilt-compile\lib\es6-init.js:61:1)
at Object. (C:\Users\xxxx\AppData\Roaming\npm\node_modules\electron-prebuilt-compile\lib\es6-init.js:63:3)
at Module._compile (internal/modules/cjs/loader.js:693:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10)
at Module.load (internal/modules/cjs/loader.js:602:32)
at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
at Function.Module._load (internal/modules/cjs/loader.js:533:3)
Just like issue of electron electron/electron#15092
or issue of electron-compile electron-userland/electron-compile#312
I'm having trouble getting LESS files I import into my main LESS file to rebuild each time. I have <link rel="stylesheet" type="text/less" href="components/App/App.less">
in my app and within App.less I have several @import "../Filter/Filter.less";
lines for other LESS in my app. I can change Filter.less and reload my app without the new changes appearing. If I put the LESS directly in App.less, reloading works every time to see the new styling. Putting it in an imported LESS file, I have to reload a few times, change App.less, and generally poke things a bunch to finally get the new styles to work. I'm actually not sure of the exact flow to get imported LESS to take effect, I usually just stumble upon it after I've been working on other parts of the app and reloading periodically.
https://github.com/cheshire137/gh-notifications-snoozer is the app in question I'm working with.
The first 3.x beta was released yesterday, and I'd love to try building my app with it. Would you please publish another build for this?
https://electronjs.org/releases
I've prepare this repo to show my problem https://github.com/pioz/electron-prebuilt-compile-issue
You can install and run with
$ git clone https://github.com/pioz/electron-prebuilt-compile-issue.git
$ cd electron-prebuilt-compile-issue
$ npm install
$ npm start
First time you run this app all works fine.
Now close the app (cmd+Q
) and edit the file stylesheets/css1.less
changing
the color from blue to red. Now rerun the app (npm start
) and the color of
Hello World! is not changed.
If I import all .less
files in index.html
separately, all is fine.
What did I do wrong? May be a bug?
Using normal electron-prebuilt
I can debug apps using the way described here:
https://github.com/electron/electron/blob/master/docs/tutorial/debugging-main-process.md
So like electron --debug-brk=5858 test/index.js
If I replace electron prebuilt
with electron-prebuilt-compile
, the same command gives me:
/home/seke/dev/purple/app/node_modules/.bin/electron --debug-brk=5858 --nolazy test/index.js
App threw an error during load
Error: Cannot find module '/home/seke/dev/purple/app/--debug-brk=5858'
at Module._resolveFilename (module.js:455:15)
at Function.Module._resolveFilename (/home/seke/dev/purple/app/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at init (/home/seke/dev/purple/app/node_modules/electron-compile/lib/config-parser.js:279:16)
at main (/home/seke/dev/purple/app/node_modules/electron-prebuilt-compile/lib/es6-init.js:38:29)
at Object.<anonymous> (/home/seke/dev/purple/app/node_modules/electron-prebuilt-compile/lib/es6-init.js:41:1)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
While I was upgrading electron-prebuilt-compile so I can make use of native ES features, I noticed there is no 1.7.2 release on npm. Please publish a 1.7.2 release ๐ I'm using 1.7.1 right now ๐
I've found an issue this morning with a missing dependency @paulcbetts/node-sass
inside electron-compilers
(see electron-userland/electron-compilers#44 for more detail).
I know this isn't an issue with this package pe se, but I notice that this package pulls in the electron-compilers
package with "*" - would it be worth locking down the version numbers so this doesn't happen in future?
For the record, I've solved my specific issue with the following npm-shrinkwrap.json
file:
{
"name": "NodeDB",
"version": "0.0.0",
"dependencies": {
"electron-compilers": {
"version": "4.0.7"
}
}
}
As of version 1.6.10
electron includes a typings file for use by developers. It would be nice if this repository also included it, seeing that it tries to stay up to date with upstream electron.
Right now the temporary workaround is to specify where the typings file is in tsconfig.json
via
"include": [ "node_modules/electron-prebuilt-compile/node_modules/electron" ]
otherwise Typescript cannot find the typings file.
Hi, I am building a React + Electron app and am having trouble once the app has been packaged for release. The es2015 syntax no longer works once the app has been built.
I've seen several posts advising the use of electron-prebuilt-compile so I uninstalled electron, ran rm -rf node_modules
and installed [email protected]. I am still receiving syntax errors.
Is there more to using this module when the application already exists?
Ultimately, if anyone has some information regarding packaging an app with es2015 syntax I would be very grateful.
Command "electron" in the app folder popups an electron window with the statement:
Drag your app here to run it.
This seems related to #7 in that npm start
throws an error, but electron .
does not.
$ npm ls electron-prebuilt-compile
/Users/zeke/zeke/ummoji
โโโ [email protected]
$ cat main.js
const {app, BrowserWindow} = require('electron')
let win
app.on('ready', () => {
let opts = {
frame: false,
transparent: true,
width: 600
}
win = new BrowserWindow(opts)
win.loadURL(`file://${__dirname}/app/index.html`)
})
$ npm start
> @ start /Users/zeke/zeke/ummoji
> electron .
App threw an error during load
ReferenceError: [BABEL] /Users/zeke/zeke/ummoji/main.js: Unknown option: base.main. Check out http://babeljs.io/docs/usage/options/ for more info
at Logger.error (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/logger.js:41:11)
at OptionManager.mergeOptions (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/options/option-manager.js:216:20)
at OptionManager.init (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/options/option-manager.js:359:12)
at File.initOptions (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/index.js:221:65)
at new File (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/file/index.js:141:24)
at Pipeline.transform (/Users/zeke/zeke/ummoji/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at BabelCompiler.compileSync (/Users/zeke/zeke/ummoji/node_modules/electron-compilers/lib/js/babel.js:225:21)
at CompilerHost.compileUncachedSync (/Users/zeke/zeke/ummoji/node_modules/electron-compile/lib/compiler-host.js:782:29)
at /Users/zeke/zeke/ummoji/node_modules/electron-compile/lib/compiler-host.js:756:23
at CompileCache.getOrFetchSync (/Users/zeke/zeke/ummoji/node_modules/electron-compile/lib/compile-cache.js:456:20)
^C
$ electron .
(App is now running fine)
^C
I'm coming from a traditional web app development environment where I use webpack pretty consistently. In using webpack, I and my team are able to import
scss files directly using a combination of loaders (sass-loader, css-loader, and style-loader).
I'm just getting started with Electron and I'm trying to use React as the framework for the front end along with sass, but I can't seem to do something like this:
// Irrelevant imports
import './styles.scss'; // <--- This doesn't work
export default class Header extends React.Component {
// React things
}
Is there a way to do this, or am I way off the mark for "best practice" when using stylesheets with React and Electron? I'm trying to avoid using webpack and equally trying to avoid having a bunch of different <link />
tags in html files.
Any help or direction would be greatly appreciated :)
Running into this issue on windows10 64bit (node-8.0.0, npm-5.0.2).
The application window doesn't launch after an npm start or a electron ./app/main.j or a electron . on a very simple hello world type app. However I do see an electron.exe process in TaskManager. If I manually terminate the process I get the following
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ben\AppData\Roaming\npm-cache\_logs\2017-06-18T18_17_45_289Z-debug.log
And inpecting the logs files reveals a stacktrace just like electron/electron-quick-start#155.
The only way I can get this to launch is by using electron-builder with build --ia32 packaging, the 64bit build doesn't launch either.
All is well in Ubuntu 16.04 land.
The following current electron versions do not currently have corresponding electron-prebuilt-compile
versions:
@paulcbetts Could you please publish releases for these soon? (My app is impacted by the race condition in 2.0.0-beta.1
.) I feel bad pestering people to work for me for free, especially other FOSS folks. If I can help, e.g. with #55, please let me know. I'm also sending a small ๐ต thank you via PayPal (using your GH email) ๐.
In case it's helpful, here's a script that lists missing versions:
// npm install npm-registry-package-info
const pkginfo = require('npm-registry-package-info');
pkginfo({
packages: ['electron', 'electron-prebuilt-compile']
}, (error, data) => {
if (error) {
throw error;
}
const { meta, data: results, failures } = data;
console.log(meta, failures);
const eVersions = Object.keys(results.electron.versions);
const epcVersions = Object.keys(results['electron-prebuilt-compile'].versions);
if (eVersions instanceof Array && epcVersions instanceof Array) {
missingVersions = eVersions
.map(ev => epcVersions.find(epcv => epcv === ev) ? null : ev)
.filter(Boolean);
console.log('Could not find electron-prebuilt-compile match for the following electron versions:', missingVersions);
}
else {
console.error('Could not fetch versions', eVersions, epcVersions);
}
});
Output:
Could not find electron-prebuilt-compile match for the following electron versions: [ '0.1.0',
'0.1.1',
'0.1.2',
'0.2.0',
'0.2.1',
'0.3.0',
'0.4.0',
'0.4.1',
'1.3.3',
'1.3.4',
'1.4.8',
'1.5.0',
'1.3.14',
'1.4.16',
'1.3.15',
'1.7.10',
'1.7.12',
'1.6.17',
'2.0.0-beta.2',
'1.8.3',
'2.0.0-beta.3' ]
I am trying to build some skeletons for electron with coffeescript and less.
Only when adding electron-prebuilt-compile as a dependency instead of electron-prebuilt. It completely breaks.
package.json
"dependencies": { "electron-prebuilt-compile": "^1.2.2", "season": "^5.3" },
"devDependencies": { "coffee-script": "~1.10.0", "cross-env": "^1.0.8", "less": "*" }
App threw an error during load
Error: Cannot find module 'babel-runtime/core-js/object/get-prototype-of'
at Module._resolveFilename (module.js:438:15)
at Function.Module._resolveFilename (C:\projectpath\node_modules\electron-prebuilt-compile\node_modules\elec
tron-prebuilt\dist\resources\electron.asar\common\reset-search-paths.js:47:12)
at Function.Module._load (module.js:386:25)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object. (C:\projectpath\node_modules\electron-prebuilt-compile\node_modules\electron-compile\l
ib\config-parser.js:8:23)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
This might have to do with the fact that npm complains about jade being deprecated?
Sample does not work with runtimeExecutable in Visual Studio Code, shortcut launch with launch.json.
Error: main.js is not available.
Hello.After updating to version 1.7.8 I encountered the following error:
Failed to compile /home/kounelios/Documents/GitHub/UGSM/src/public/views/index.jade: Cannot find module 'acorn'
Error: Cannot find module 'acorn'
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (/home/kounelios/Documents/GitHub/UGSM/node_modules/electron-prebuilt-compile/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/kounelios/Documents/GitHub/UGSM/node_modules/constantinople/index.js:3:13)
at Object.<anonymous> (/home/kounelios/Documents/GitHub/UGSM/node_modules/constantinople/index.js:102:3)
at Module._compile (module.js:571:32)
at Object.require.extensions.(anonymous function) [as .js] (/home/kounelios/Documents/GitHub/UGSM/node_modules/electron-compile/lib/require-hook.js:77:14)
at Module.load (module.js:488:32)
However after npm install --save acorn
everything works fine.
Any ideas what caused it?
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/electron-packager-compile
command: "electron myApp" throws:
Error: ENOENT: no such file or directory, open 'C:\0000_TRANSFER\HTML5\vuedevtools\manifest.json'
Even if I comment the inclusion:
//BrowserWindow.addDevToolsExtension("./vuedevtools/");
๐ Please publish updated releases to npm
(for v2.0.5 and v3.0.0-beta.2 v3.0.0-beta.3)
https://github.com/electron/electron/releases
Hey, I wanted to know that if electron-prebuilt-compile uses NODE_MODULE_VERSION 57 or is this an electron-prebuilt or electron-compile specific question. I am using a module that uses NODE_MODULE_VERSION 57 and conflicts with the electron is there a way to bump the NODE_MODULE_VERSION in electron prebuilt compile.
I'm trying to add electron to my React app, and have followed I get the error below when running electron .
Uncaught Exception:
TypeError: Cannot use 'in' operator to search for 'name' in undefined at createCompilerHostFromBabelRcSync (/Users/xxx/Sites/tester/node_modules/electron-compile/lib/config-parser.js:363:14)
Is there an example of it working with React that maybe I could follow? Thanks for your time!
I cloned the electron/electron-quick-start project, followed the instructions to add this to the project, ran it and got
Cannot find module 'debug/browser'
in the dev tools.
Hello,
the code in es6-init.js fails to find the correct package.json when it is called from another node-module that has been installed via nvm.
In this case, findPackageJson will walk up all the way to the .nvm directory, and subsequently electron-compile will find a .cache directory there, which is not meant for it. Then it crashes.
Scenario:
I have a project using electron-prebuilt-compile
I call electron with electron-mocha, like this:
ELECTRON_PATH=./node_modules/.bin/electron electron-mocha ./test
This fails with:
App threw an error during load
Error: ENOENT: no such file or directory, open '/Users/wodev/.nvm/.cache/compiler-info.json.gz'
Analysis:
electron-mocha ends up calling electron with a path like below:
$HOME/.nvm/versions/node/v8.1.2/lib/node_modules/electron-mocha/index.js
Since findPackageJson skips over everything under a node_modules folder, it ends up in the nvm home directory.
I just installed via yarn and i'm getting this warning in my console:
Warning, the following targets are using a decimal version:
electron: 1.6
We recommend using a string for minor/patch versions to avoid numbers like 6.10
getting parsed as 6.1, which can lead to unexpected behavior.
I'm not seeing any quick resolutions via the google. Call me OCD but i'd prefer not to have a warning when i fire up my badass electron-prebuilt-compile based app. How do i go about "using a string for minor/patch versions" ? It seems to me that the version is already a string in my package.json. What don't i know here.
Thanks ya'll
I'm new to electron, but would like to use this prebuilt one to run 'React components out-of-the-box'.
It would be good if here is a concrete example included like react-todo component.
I really don't know how I make directory structure.
I am getting the error:
TypeError: Cannot read property 'on' of undefined
edit: to clarify, the app does not open any windows, it display's a error box and hangs.
edit2: it was starting fine with electron.
This supposedly points to the following line of code:
app.on('ready', createMainWindow);
I am importing as
const {app, BrowserWindow, session} = require('electron-prebuilt-compile');
I kind of want to know what I am doing wrong, since there was no notes in the readme I thought that this was a drop-in replacement for the standard electron package that would let me use ES6 scripts to help keep my sanity.
Hey there,
I want to ship electron-prebuilt-compile within my npm package and define how to start from cli with node. What I'm searching for is something similar to this cli.js
file:
#!/usr/bin/env node
var spawn = require('child_process').spawn
var electron = require('electron-prebuilt')
var join = require('path').join
var app = spawn(electron, ['main.js'], {
stdio: 'inherit',
cwd: join(__dirname)
}).on('exit', function (i, m) {
process.exit()
})
so I can define in my package.json
"bin": {
"my-startup-command": "./cli.js"
},
I tried to just swap electron-prebuilt
to electron-prebuilt-compile
but it results in the following error:
child_process.js:360
throw new TypeError('"file" argument must be a non-empty string');
^
TypeError: "file" argument must be a non-empty string
at normalizeSpawnArguments (child_process.js:360:11)
at exports.spawn (child_process.js:465:38)
at Object.<anonymous> (/Users/philipp/git/photo-booth/cli.js:7:11)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
Any suggestions? Thanks!
apparently electron uses default keys for google and you have ot edit the source of chromium manually to change this. so is this package completely useless if you need to use google apis? i am including the google with my given key in my index.html but that does nothing.
For context, see electron/packager#608 (comment)
If I run the process with electron-prebuilt-compile in the terminal, and I exit the process (ctrl+c) sometimes the process does not exit.
Hi,
Are there any plans to support latest electron 1.4.x version, as currently 1.3.x is a hard dependency.
Thanks.
Hi!
I've used this in a project that leverages async/await, and although it works perfectly fine when I just do electron .
, whenever I use electron-packager
I get Unexpected token (
errors in the built app, leading me to believe the build process isn't transpiling my JS and thus Electron is choking on the async functions.
Any idea what extra config I need to do to get EPC to build correctly? Thanks!
We've been chatting about this issue and trying to resolve it, and I think I've actually narrowed it down to electron-prebuilt-compile
, and not electron-compile
like we originally thought.
Check out this repo: https://github.com/aendrew/electron-compile-no-css-example
In master, I bootstrap electron-compile
without electron-prebuilt-compile
and the square turns red when I build the app.
If I use electron-prebuilt-compile
(as in the with-prebuilt-compile
branch), the square stays green.
This is because, while the text/less
file gets run and rendered by Electron correctly, the text/css
file with the background: red !important
declaration does not.
At this point, I have to admit I have no idea what is going on here.
Edit: Hold on a second, I may have just run electron
with the master
branch and am confirming I'm reporting this correctly.
I am trying to use different version of electron-prebuilt-compile which has chrome version 51. So I am doing npm uninstall first version of electron-prebuilt-compile (1.6.11) and npm install second version (e.g. 1.2.6). I see below error message
Debugging with legacy protocol because a runtime executable is set.
electron-forge-vscode-win.cmd --debug-brk=20173
ร Locating Application
Electron forge was terminated:
You must depend on an EXACT version of "electron-prebuilt-compile" not a range
my package.json file is attached here
is there any documentation around it?
With the last electron-compile version update, you forgot to update the package.json version and release on NPM. I can't get the last version...
Thanks!!
When I run electron app with cachedir
argument electron . -c ./.cache/
to specify the cache directory of electron-compile
, it runs correctly if ./.cache/
directory does not exist, but when I close and run the app again (./.cache/
is created and populated with cache data), it threw this error:
App threw an error during load
Error: Asked for /Users/huy/Workspace/js/electron/electron-compile-boilerplate/app/main.ts but it was not precompiled!
at FileChangedCache.getHashForPathSync (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/file-change-cache.js:313:15)
at CompilerHost.compileReadOnlySync (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/compiler-host.js:545:41)
at CompilerHost.compileSync (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/compiler-host.js:470:37)
at Object.require.extensions.(anonymous function) [as .ts] (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/require-hook.js:66:48)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at init (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/config-parser.js:292:16)
at main (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-prebuilt-compile/lib/es6-init.js:40:29)
I don't get that error when I run without the cachedir
argument (electron-compile
will use the default temporary directory cache compileCache_
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.