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

A Java script error occured in the main process #35

Closed
Whiteshadow-hacker opened this issue Nov 2, 2020 · 28 comments
Closed

A Java script error occured in the main process #35

Whiteshadow-hacker opened this issue Nov 2, 2020 · 28 comments
Labels
🐛 bug Something isn't working

Comments

@Whiteshadow-hacker
Copy link

I installed the google assistant (unofficial client) from the ubuntu software store. the installation was smooth, but when i try to launch the application from my applications menu, it opens a pop up saying that a java error occured in the main process i have attached a screen shot of the pop-up down here. and about my system specificaion, i use ubuntu 20.04.1
Screenshot from 2020-11-02 19-49-58

@Whiteshadow-hacker
Copy link
Author

does anybody else face the same issue ?? please help me out if you fixed this error !!!

@Melvin-Abraham
Copy link
Owner

@Whiteshadow-hacker Well, I cannot reproduce this error. Also, to be honest, I have no idea what happened there. So, it might be a problem from electron's side. Anyway, I will probably add a commit for verbose logging in the console/file which could provide some idea where exactly error occurs. Until then, if you can clone this repo and run/build it, let me know if the error occurs again...

@Whiteshadow-hacker
Copy link
Author

@Melvin-Abraham dude thank you very much!!! . i am really glad that you responded to my issue.
but just after i read your response i tried running the .appimage from your releases. even this time i got the very same error. please help me out. i would really love to use google assistant on my computer.
Screenshot from 2020-11-03 18-37-35

@Whiteshadow-hacker
Copy link
Author

if you still want a clear idea of what's happening please see this video which I have screen recorded:: https://drive.google.com/file/d/1jmrBnHnA7ocWEgHo9vdrRuk2nvd2kQlB/view?usp=sharing

@Whiteshadow-hacker
Copy link
Author

I tried the .exe in windows and it works just awesome !!!! after testing it in windows, now i feel even more curious to have it on my main computer in which i run ubuntu. i am really impressed by your program. please help to get this on my linux !!!!

@Melvin-Abraham
Copy link
Owner

@Whiteshadow-hacker Did you try cloning this repo and executing npm start?

@Whiteshadow-hacker
Copy link
Author

dude, I was not completely into the idea of installing through npm but since you said, I tried and got a new error !!!
Screenshot from 2020-11-04 22-52-34

@Whiteshadow-hacker
Copy link
Author

if you want the log file of the error, i can provide it !!

@Whiteshadow-hacker
Copy link
Author

and here is the error when I executed npm start ::
Screenshot from 2020-11-04 22-56-51

@Melvin-Abraham
Copy link
Owner

@Whiteshadow-hacker Can you try deleting the package-lock.json file and try again?

@Whiteshadow-hacker
Copy link
Author

dude, can you please tell me how to execute npm run with the --no-sandbox flag ??, when i removed the package-lock.json it installed well but i dont know how to run it in root

@Whiteshadow-hacker
Copy link
Author

dude, I figured out the problem !!! the error is neither with electron nor with your code !!! the problem is that it is not running in root !!! when I try running it as a normal user it works good. but not as root ........ can you please tell me how to run it in root??, because i am a guy who always use root account !!!! anyways thank you very much for you support..... i became a fan of yours 👍

@Whiteshadow-hacker
Copy link
Author

if you can please tell me how to run it on root!!

@Whiteshadow-hacker
Copy link
Author

or else if possible can you please release a .deb of the code ?? so it'll be easy for Debian users to install.

@Melvin-Abraham
Copy link
Owner

@Whiteshadow-hacker I think you are already a root user. You might notice a # instead of $ at the end of the prompt meaning you are the root user.

@Melvin-Abraham
Copy link
Owner

Also, just out of curiosity, can you explain how you figured out what the problem was?

@Melvin-Abraham
Copy link
Owner

After deleting the package-lock.json you need to run npm install again. After that is done, you can proceed to npm start. Also, you don't need to use any flags when executing the start command...

Can you let me know if this causes any issues?

@Whiteshadow-hacker
Copy link
Author

Whiteshadow-hacker commented Nov 5, 2020

Screenshot from 2020-11-05 23-05-27
yes, dude, when I run npm start it says "Running as root without --no-sandbox is not supported" that's why i asked you how to run as root !!! I figured out the problem just by my instinct, i thought of running it in a normal user and it worked !!! so i concluded that there is some problem with the root. there is no error while doing npm install.

@Whiteshadow-hacker
Copy link
Author

dude, i would really really love to use your google-assistant on my computer i have been searching a google-assistant setup for my linux for months. please help me run it on root !!!

@Melvin-Abraham
Copy link
Owner

Try changing "start": "electron ." under "scripts" in package.json to "start": "electron --no-sandbox ." and try npm start again. Tell me if you encounter any issues...

@Whiteshadow-hacker
Copy link
Author

dude, I am sorry to say but I got the very same error again !!!!
Screenshot from 2020-11-06 19-38-51

@Melvin-Abraham
Copy link
Owner

@Whiteshadow-hacker Sorry for the delay. I have added a new commit for verbose logging which might give an idea at which point the error occurs. You can run the assistant with verbose logging in the console by executing the following line:

npm run start:verbose

PS: Be sure to pull the latest changes from this repo beforehand.

@jfretin
Copy link

jfretin commented Nov 13, 2020

Hello there @Melvin-Abraham . I had the same error for some time, so I took the time to debug. It seems that the problem is that in some case, the window size is not what has been defined in onAppReady function (ie. 1000x420).

If I output window size as fetched in line 369 of app.js
let windowSize = mainWindow.getSize();
it gives me 1001x421 ... So the division by 2 gives a float, and I think it's what throw the error.

If I force window size, for example:
mainWindow.setPosition( (width / 2) - (1000 / 2) + x, (height) - (420) - 10 );
it launches without an error!

I don't know, maybe it's a problem with the current theme maybe. I'm on Ubuntu.

If you want more information on my setup, please let me know.

@Melvin-Abraham
Copy link
Owner

@jfretin Thanks a lot for taking time to figure that out 🥳. I totally missed the information that setPosition() only accepts integer as an argument and also that the window size may vary from what is defined. So, a simple Math.floor() would fix this issue right away. Let me add a commit for the same. Again, thanks for this :)

@jfretin
Copy link

jfretin commented Nov 13, 2020

I confirm it now launches without error! Thanks!

@Whiteshadow-hacker can you try this fix please?

@Whiteshadow-hacker
Copy link
Author

@jfretin @Melvin-Abraham thank you very much for your efforts guys !!! i really appreciate that 😃 but can you please be clear on what i have to do now to get it working ?, i am not a javascript programmer !!!

@Melvin-Abraham
Copy link
Owner

@Whiteshadow-hacker There's nothing that can be done about this as it is a bug within the app itself. This will be patched in the future release. For the time being you can pull all the latest changes from this repo (using git pull origin master) and build it locally (using npm run dist).

Hope that will work :)

@Whiteshadow-hacker
Copy link
Author

@Melvin-Abraham thank you very much dude, I've become a fan of your application. i hope it'll come soon !!!! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants