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

How to package this starter-app #1

Closed
wushan opened this issue Mar 16, 2017 · 14 comments
Closed

How to package this starter-app #1

wushan opened this issue Mar 16, 2017 · 14 comments

Comments

@wushan
Copy link

wushan commented Mar 16, 2017

I am new to electron and I just tried to use electron-packager to make an executable app with electron-packager . Although there isn't any error messages but the app generated is not usable.

How should I do to build this app on desktop ? did I missing any configs ?

Thanks for answering.

This question is available on Nuxt.js community (#c2)
@detrohutt
Copy link
Collaborator

What operating system are you using? I'll see if I can get it working and make an example for you to follow.

@wushan
Copy link
Author

wushan commented Mar 16, 2017 via email

@detrohutt
Copy link
Collaborator

Unfortunately I wasn't able to get it working today. :( I'll have to mess around with it some more when I have time. But it's nothing you did wrong, it's just a problem with this project currently.

@wushan
Copy link
Author

wushan commented Mar 21, 2017

Any news about this ?

@detrohutt
Copy link
Collaborator

detrohutt commented Mar 21, 2017

I was able to narrow the problem down to a conflict between the Nuxt.render middleware function and Electron. Unfortunately I'm still not able to solve the problem. My Mac OS debugging skills aren't that great.. I've made a reproduction of the issue here in case @atinux or anyone more familiar with Nuxt.render/Mac debugging has time to take a look. Sorry, I wish I could have been of more help! :/

@atinux
Copy link
Member

atinux commented Mar 24, 2017

Ok this is really weird, I can launch the app from the command line:

./electron-example-darwin-x64/electron-example.app/Contents/MacOS/electron-example 

Nuxt is working and the app as well, if I click on the icon, the app quit after 2 seconds, do you have the same problem @wushan ?

@wushan
Copy link
Author

wushan commented Mar 24, 2017 via email

@atinux
Copy link
Member

atinux commented Mar 24, 2017

Ok I found how to launch the logs:

open ./electron-example-darwin-x64/electron-example.app/Contents/MacOS/electron-example 

I will investigate

@detrohutt
Copy link
Collaborator

@atinux yes I added the 2 second delay to make it obvious what line was causing the crash(see the Readme.md on that branch).. From messing with it before the most I could figure is that electron-packager modifies the environment variables and is leaving out something required by Nuxt.render. But I was never able to see any actual error messages so that is just a guess.

@atinux
Copy link
Member

atinux commented Mar 24, 2017

@detrohutt the actual error is:

> No build files found, please run `nuxt build` before launching `nuxt start`

So Nuxt.js cannot launch himself, because I believe the .nuxt folder has not been included by electron-packager

@atinux
Copy link
Member

atinux commented Mar 24, 2017

I found the solution, when we launch the application via the icon, process.cwd() used by Nuxt.js to know which directory it has been launched is different.

You can apply the fix by adding this line: 3f16652

@atinux atinux closed this as completed Mar 24, 2017
@detrohutt
Copy link
Collaborator

Amazing. Thanks so much for your help. It's embarrassing how much time I spent trying to fix it lol. I guess it helps to know what you're doing. :D

@atinux
Copy link
Member

atinux commented Mar 24, 2017

It helps indeed, but I had to look at some issue of electron-packager to be sure, but thanks a lot for making the issue-1-repro branch, it helped me a lot to fix the bug (I never used electron-packager before)!

I updated the master branch to add electron-packager 👍

@wushan
Copy link
Author

wushan commented Mar 24, 2017 via email

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

3 participants