Uncaught SyntaxError: Unexpected token function
Closed this issue · 6 comments
On line 130 in the no settings.html file
async function getFolder() { f = await eel.get_folder($("#path").val())(); console.log(f); $("#path").val(f); }
I get an error saying Uncaught SyntaxError: Unexpected token function
I believe this is preventing me from pressing Done on the setup page but it may be another problem if this is not the apparent problem.
Hey, by the look of it you are using a browser which does not support the async / await syntax. Which seems pretty unlikely because they are widely supported nowadays.
Which browser does the application use to display the interface? And which version is that browser currently on?
And you are right that this breaks the functionality on the page. But even if you got past that page it wouldn't help you because the other pages also make use of async functions (should that be the problem).
It seems you are relatively experienced with the browser (considering you found where the error was displayed) - If you type async function test(){}
into the console of the browser the application uses to display the GUI - do you also get that same error? Or is there no error then.
Doing the async function test(){}
returns the same syntax error. I am currently on chrome 83, however, the application opens chromium version 51. I don't know if this could be the problem, but just in case, is there a way to change the code so I could make it open in Chrome? I will also try using Microsoft edge despite my neverending hatred for it.
I have found by changing 'mode': "chrome-app",
to 'mode': "edge"
in main.py the app opens in firefox for some reason, but also works. While I would still appreciate any possible solution to get chrome to work, I can work with firefox for now.
Chrome should work by doing the following (assuming you are on windows):
I took a look at the library which is used to display the GUI (which is eel).
And they check for the chrome path at the following registry key:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
and/or
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
(see here)
So if you go there and change that to the path of your current Chrome installation it should work.
Alternatively you can either uninstall Chromium or update it to a newer version.
Works like a charm simply edited the registry and I'm running on chrome. Thank you so much for your help