Comments (38)
This issue is also appearing on latest update "1.4.0" with electron version "6.0.4".
There is no warning or error, just "INFO Launching Electron..." and nothing else.
This command can solve this problem:
sudo chown root node_modules/electron/dist/chrome-sandbox && sudo chmod 4755 node_modules/electron/dist/chrome-sandbox
from vue-cli-plugin-electron-builder.
Hi!
- Running
yarn electron bg.js
andyarn electron ./bg.js
: It works - Running
node ./script-{n}.js
: It works too
Every time with the same result.
Btw, app is blank in http://localhost:8080 and an error is shown in the console:
Regards!
from vue-cli-plugin-electron-builder.
This issue is also appearing on latest update "1.4.0" with electron version "6.0.4".
There is no warning or error, just "INFO Launching Electron..." and nothing else.
from vue-cli-plugin-electron-builder.
@nklayman I'm having launch issues in both Windows 10 and Windows 8.1 with the 2.0.0-beta.5 release. I created a ticket #693.
Basically - electron:serve
on Windows 10 or 8.1 with ANY electron version is not working for me. If I downgrade to the pre-2.0 plugin, everything works. I can't figure out what may have changed?
Launching the dev window works fine in both Mac and Linux.
from vue-cli-plugin-electron-builder.
it's not run on linux now
when i run npm run electron:serve
from vue-cli-plugin-electron-builder.
Hello everybody! I had the same problem with a vue app. My OS is GNU/Linux Debian 10 (x64). I solved it this way:
(1) sudo sysctl kernel.unprivileged_userns_clone=1
(2) remove node_modules folder
(3) run npm install
(4) run npm run electron:serve
After this, everything works normally
from vue-cli-plugin-electron-builder.
@algil @TAGC both of your projects worked fine when I cloned them on Windows. This seems to be a macOS related issue. Unfortunately, I don't have access to a Mac, making this hard to debug. I'm going to create a repo with some scripts I'd like you to run and post it here soon. Thanks for your help.
from vue-cli-plugin-electron-builder.
To those of you with the issue, I ask for more help. Please clone this repo. Then, do the following:
- install deps with
yarn
- run
yarn serve:electron
. Leave it running and make sure it is hosted onhttp://localhost:8080
. - while that is running, run
yarn electron bg.js
, and thenyarn electron ./bg.js
. Let me know if either works. - while the server is still running, even if the previous commands worked, run
node ./script-1.js
. - repeat step 5 with scripts 2-6.
- reply to this issue with the results and, if you haven't already, the information I previously requested.
Thanks you all, hoping to get this fixed so you can try this out!
from vue-cli-plugin-electron-builder.
Thanks for all of your help! alpha.9 uses the new launch method 🎉! Don't forget to unlink the test-launch-1 package.
from vue-cli-plugin-electron-builder.
@jerryshell sadly this doesn't fix issue on Windows. I'm now using electron 5.x.x until it has been fixed 👌
from vue-cli-plugin-electron-builder.
This issue is also appearing on latest update "1.4.0" with electron version "6.0.4".
There is no warning or error, just "INFO Launching Electron..." and nothing else.This command can solve this problem:
sudo chown root node_modules/electron/dist/chrome-sandbox && sudo chmod 4755 node_modules/electron/dist/chrome-sandbox
This worked for me!
npm electron:serve was not Giving any output but finishes compiling and success toast in the terminal! that's it after this patch, it works. Flawlessly.
from vue-cli-plugin-electron-builder.
Could everyone who has this issue please try these steps:
- delete node_modules folder
- run
yarn cache clean @vue/cli-service
andyarn cache clean vue-cli-plugin-electron-builder
(or npm equivalent) - make sure to use [email protected]
- re-install dependencies
- try it again
Then, please reply with the following:
- Did it work?
- os and version
- yarn/npm and version
- node version
- vue-cli version
- vue-cli-plugin-electron-builder version
- (if possible) link to your github repo
Thanks a lot guys, I really appreciate the help and hope we can resolve this soon 😄 .
from vue-cli-plugin-electron-builder.
Did it work?
yarn build:electron
works for me, yarn serve:electron
gets stuck indefinitely as before.
os and version
macOS High Sierra v10.13.5
yarn/npm and version
Tried with npm 5.6.0, npm 6.1.0 and yarn 1.7.0.
node version
node v10.4.1
vue-cli version
3.0.0-rc.2
vue-cli-plugin-electron-builder version
1.0.0-alpha.5
(if possible) link to your github repo
from vue-cli-plugin-electron-builder.
This issue happened to me when the project was compiling with warnings.
Electron would not launch with yarn serve:electron
, but would launch as soon as I stopped the script with ctrl-c
.
The issue disappeared when I resolved the warnings in my code.
This happened with [email protected]
from vue-cli-plugin-electron-builder.
Hi!
I've upgrade to latest alpha (6) and this was the result:
Did it work?: No
os and version: MacOS X 10.13.4
yarn/npm and version: yarn (1.3.2) npm (6.1.0)
node version: 10.2.1
vue-cli version: 3.0.0-beta.16
vue-cli-plugin-electron-builder version: 1.0.0-alpha.6
link to your github repo: https://github.com/algil/vue-ts
Thanks!!
from vue-cli-plugin-electron-builder.
Testing on Windows 10. With the repo you provide:
- Running
yarn serve:electron
worked fine off the bat - it bundles and launches as expected - All other commands (
yarn electron bg.js
...node ./script-6.js
) fail with "Access Error: 404 - Not Found", but that's fine becauseyarn serve:electron
works already anyway
I also found that yarn serve:electron
works fine for my own repo (TAGC/vue-electron-bug) now that I'm trying it on Windows 10. Seems to confirm that it's a macOS / unix-specific issue.
from vue-cli-plugin-electron-builder.
@algil based on the feedback you gave, i created a new branch in this repo (test-launch-1). Go ahead and clone this repo, then do the following:
- switch to the test-launch-1 branch (
git checkout test-launch-1
) - install deps (
yarn install
) - link it with
yarn link
- in the
vcp-electron-builder-launch-bug
repo, runyarn link vue-cli-plugin-electron-builder
- run
yarn serve:electron --launch 1
- run
yarn serve:electron --launch 2
- run
yarn serve:electron --launch 3
- let me know which launch methods work
Thanks for your help!
Edit: also, did the require is not defined
error appear in the browser or in electron?
from vue-cli-plugin-electron-builder.
@nklayman All three methods launched Electron, but app launched with method 2 crashed.
Here is the stack trace from the dev tools:
webpack:///(webpack)/hot/dev-server.js?:7 Uncaught Error: [HMR] Hot Module Replacement is disabled.
at eval (webpack:///(webpack)/hot/dev-server.js?:7:8)
at Object../node_modules/webpack/hot/dev-server.js (http://localhost:8080/app.js:998:1)
at __webpack_require__ (http://localhost:8080/app.js:20:30)
at eval (webpack:///multi_(webpack)-dev-server/client?:2:1)
at Object.0 (http://localhost:8080/app.js:1150:1)
at __webpack_require__ (http://localhost:8080/app.js:20:30)
at http://localhost:8080/app.js:84:18
at http://localhost:8080/app.js:87:10
And this is from the terminal after I kill the script:
TypeError: Cannot read property 'on' of undefined
at serve.then.server (/Users/username/sandbox/vue-cli-plugin-electron-builder/index.js:262:17)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
Testing on macOS High Sierra 10.13.5
from vue-cli-plugin-electron-builder.
Hi @nklayman! You're welcome.
Sorry for my delay. I just tried it and this are the results:
- launch 1: WORKS
- launch 2: WORKS but I get the same error commented by @od1k in above comment
- launch 3: WORKS
Regards!
from vue-cli-plugin-electron-builder.
Great!
It works with alpha.9!
Thanks!
from vue-cli-plugin-electron-builder.
alpha.9 launches the electron app fine in vue-electron-bug
, even on macOS (haven't tried Windows but that probably works too). 👍
In a real Electron project that uses TypeScript I get this error after updating to alpha.9, re-invoking the plugin (vue invoke electron-builder
) and then trying to launch my app:
$ npm run dev
> @<company>/[email protected] dev /Users/<me>/Documents/VSCode/atm-prototype
> vue-cli-service serve:electron
Bundling main process:
[ 'multi ./src/background.ts\nModule not found: Error: Can\'t resolve \'ts-loader\' in \'/Users/<me>/Documents/VSCode/atm-prototype\'\nresolve \'ts-loader\' in \'/Users/<me>/Documents/VSCode/atm-prototype\'\n Parsed request is a module\n using description file: /Users/<me>/Documents/VSCode/atm-prototype/package.json (relative path: .)\n resolve as module\n /Users/<me>/Documents/VSCode/node_modules doesn\'t exist or is not a directory\n /Users/<me>/Documents/node_modules doesn\'t exist or is not a directory\n /Users/<me>/node_modules doesn\'t exist or is not a directory\n /Users/node_modules doesn\'t exist or is not a directory\n /node_modules doesn\'t exist or is not a directory\n looking for modules in /Users/<me>/Documents/VSCode/atm-prototype/node_modules\n using description file: /Users/<me>/Documents/VSCode/atm-prototype/package.json (relative path: ./node_modules)\n using description file: /Users/<me>/Documents/VSCode/atm-prototype/package.json (relative path: ./node_modules/ts-loader)\n no extension\n /Users/<me>/Documents/VSCode/atm-prototype/node_modules/ts-loader doesn\'t exist\n .js\n /Users/<me>/Documents/VSCode/atm-prototype/node_modules/ts-loader.js doesn\'t exist\n .json\n /Users/<me>/Documents/VSCode/atm-prototype/node_modules/ts-loader.json doesn\'t exist\n as directory\n /Users/<me>/Documents/VSCode/atm-prototype/node_modules/ts-loader doesn\'t exist\n[/Users/<me>/Documents/VSCode/node_modules]\n[/Users/<me>/Documents/node_modules]\n[/Users/<me>/node_modules]\n[/Users/node_modules]\n[/node_modules]\n[/Users/<me>/Documents/VSCode/atm-prototype/node_modules/ts-loader]\n[/Users/<me>/Documents/VSCode/atm-prototype/node_modules/ts-loader.js]\n[/Users/<me>/Documents/VSCode/atm-prototype/node_modules/ts-loader.json]\n @ multi ./src/background.ts' ]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @<company>/[email protected] dev: `vue-cli-service serve:electron`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @<company>/[email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
from vue-cli-plugin-electron-builder.
Try running yarn add --dev ts-loader
as it seems like that is the error. TS-loader should be installed with cli-plugin-typescript as it is listed in the package.json. If that doesn't work please post your package.json as well.
from vue-cli-plugin-electron-builder.
ts-loader
was already a transitive dependency via cli-plugin-typescript
like you point out:
$ npm ls ts-loader
@<company>/[email protected] /Users/<me>/Documents/VSCode/atm-prototype
└─┬ @vue/[email protected]
└── [email protected]
However, installing it directly allowed the launch to get a lot further before failing:
$ npm run dev
> @<company>/[email protected] dev /Users/<me>/Documents/VSCode/atm-prototype
> vue-cli-service serve:electron
Bundling main process:
Hash: 46cac84ec1affb4607fe
Version: webpack 4.12.0
Time: 1103ms
Built at: 22/06/2018 20:08:59
Asset Size Chunks Chunk Names
background.js 4.68 KiB background [emitted] background
Entrypoint background = background.js
[./src/background.ts] 1.46 KiB {background} [built]
[electron] external "electron" 42 bytes {background} [built]
[path] external "path" 42 bytes {background} [built]
[url] external "url" 42 bytes {background} [built]
[0] multi ./src/background.ts 28 bytes {background} [built]
Starting development server:
INFO Starting development server...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
94% after seal
ERROR Failed to compile with 1 errors 20:09:07
This dependency was not found:
* assets/grid-tile.png in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"/Users/<me>/Documents/VSCode/atm-prototype/node_modules/.cache/v
ue-loader","cacheIdentifier":"35be9504-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cach
e-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/workspace/BlueprintTile.vue?vue&type=template&id=3dc92667&
functional=true
To install it, you can run: npm install --save assets/grid-tile.png
Type checking and linting in progress...
No type errors found
No lint errors found
Version: typescript 2.9.2, tslint 5.10.0
Time: 8553ms
I think the problem is that when I try launching it, it's not using the webpack.config that vue-cli generates. For example, running vue inspect
shows me that the vue-cli webpack.config would bundle up my images with url-loader
:
test: /\.(png|jpe?g|gif|webp)(\?.*)?$/,
use: [
{
loader: 'url-loader',
options: {
limit: 4096,
name: 'img/[name].[hash:8].[ext]'
}
}
]
from vue-cli-plugin-electron-builder.
Make sure you use a relative path to your assets directory as described in the Vue cli docs. Assets in the public directory require extra config as of now (update coming soonish) but src/assets should work as-is. Im camping over the weekend w/out cell service so I won't be able to reply after this, sorry.
from vue-cli-plugin-electron-builder.
Check the README as I added instructions for handling static assets. Make sure you are using 1.0.0-alpha.10 as it has the new features.
from vue-cli-plugin-electron-builder.
@chinafreak, with the answer @jerryshell gave, I was thinking maybe it is related to this issue #1972 (I'm not sure)
You could try :
sudo sysctl kernel.unprivileged_userns_clone=1
electron/electron#17972(comment)
from vue-cli-plugin-electron-builder.
@chinafreak your issue is probably the same as #378.
from vue-cli-plugin-electron-builder.
@Vallevard again, I'm not using linux, so therefore I can't use this command on Windows. 😄
@nklayman yeah that could it be. Then I'll use electron 5 as long it not fixed. I still prefer to use my Dark Mode of Windows lol. Thanks!
from vue-cli-plugin-electron-builder.
On my Windows 10 Workstation, both electron:serve and electron:build work flawlessly. On my Windows 10 Laptop electron:build works, but electron:serve gets stuck. The laptop version is a complete fresh install of my project with yarn. Really weird.
from vue-cli-plugin-electron-builder.
On my Windows 10 Workstation, both electron:serve and electron:build work flawlessly. On my Windows 10 Laptop electron:build works, but electron:serve gets stuck. The laptop version is a complete fresh install of my project with yarn. Really weird.
Exact same thing happening to me. Got it working on my other machine, cloned the repo, ran yarn and now same error. Pretty much sucks because this is my first outing with any of this stuff.
from vue-cli-plugin-electron-builder.
Didn't find this thread again, but what worked for me was updating Node.js to the latest version.
from vue-cli-plugin-electron-builder.
What "worked" for me was just repeating the steps of installation and copying the files over to the directory, performing a merge and then a pull that resulted in "Already up to date". Time to move on to actually doing something.
from vue-cli-plugin-electron-builder.
@jerryshell sadly this doesn't fix issue on Windows. I'm now using electron 5.x.x until it has been fixed 👌
Yeah, I couldn't get electron to launch at all until I downgraded down to 5.0.13.
from vue-cli-plugin-electron-builder.
I am using electron 6.0.0, I run yarn electron:serve
and it's launched the app.
from vue-cli-plugin-electron-builder.
@linuxArg Do you really want to open up your kernel to a bunch of security vulnerabilities just to be able to run an electron app though?
from vue-cli-plugin-electron-builder.
Make sure you are running yarn electron:serve
and not yarn serve
, note to self 😅
from vue-cli-plugin-electron-builder.
for anyone stuck on Launching Electron or getting this error when running yarn
ERROR: There are no scenarios; must have at least one.
this is because of cmdtest installed on your system which comes installed on a lot of debian based distros
all you have to do is delete that package with : sudo apt remove cmdtest and install yarn after with npm
from vue-cli-plugin-electron-builder.
This works, I can confirm.
from vue-cli-plugin-electron-builder.
Related Issues (20)
- Unable to Launch Electron App in Development Environment on Specific Computer
- What project to use with Vite? HOT 1
- Unable to build my vue-cli app using vue-cli-plugin-electron-builder 2.1.1
- Any plans to release stable version of vue-cli-plugin-electron-builder 3.0 in near future?
- Unable to modify Heap memory limit
- Can I ask a question,when I use the utilityProcess.fork in main process,what is the param modulePath?Thanks
- Missmatch of dependencies versions between NPM and github HOT 2
- Error: write EPIPE when killElectron
- Why is navigator.bluetooth undefined after packaging? HOT 1
- electron-builder build and install, run with error Cannot read property '_android' of undefined HOT 3
- V-bind() in CSS no longer works when upgrading Electron version
- ERROR: You are using an outdated version of NPM. HOT 1
- Cannot import and use mqtt.js in main process HOT 1
- Socket.io is not working after packing to exe
- Electron does not launch on Raspberry Pi 64-bit (arm64)
- Do not compress the mainBundle during packaging
- Question: How to build a utility process?
- How to enable deep linking?
- Electron Builder does not include dependencies prefixed with "node:" HOT 1
- Incorrect loading of static svg files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-cli-plugin-electron-builder.