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

[homebridge-config-ui-x] SyntaxError: Unexpected token % #299

Closed
marcoschmidt79 opened this issue May 17, 2019 · 18 comments
Closed

[homebridge-config-ui-x] SyntaxError: Unexpected token % #299

marcoschmidt79 opened this issue May 17, 2019 · 18 comments
Labels

Comments

@marcoschmidt79
Copy link

I have installed config-ui-x 4.4.1 and node 12.2.0. after upgrading to 4.4.1 i get in 3 out of 8 instances when calling the web interface the following error message in the log

Mai 17 19:38:59 homebridge homebridge[25119]: [2019-5-17 19:38:59] [homebridge-config-ui-x] SyntaxError: Unexpected token %
Mai 17 19:38:59 homebridge homebridge[25119]: [2019-5-17 19:38:59] [homebridge-config-ui-x] SyntaxError: Unexpected token %
Mai 17 19:39:00 homebridge homebridge[25119]: [2019-5-17 19:39:00] [homebridge-config-ui-x] SyntaxError: Unexpected token %
Mai 17 19:39:01 homebridge homebridge[25119]: [2019-5-17 19:39:01] [homebridge-config-ui-x] SyntaxError: Unexpected token %

@cmdshft
Copy link

cmdshft commented May 18, 2019

Had this same issue after upgrading a plugin via the webui. I had to edit my json.config and remove the plugin via NPM to restore functionality.

@oznu
Copy link
Member

oznu commented May 19, 2019

I think I know where this is is coming from, 4.4.2 should add a bit more detail to these messages to help figure it out.

@marcoschmidt79
Copy link
Author

Ok, i updated an:

Mai 19 16:53:55 homebridge homebridge[21414]: [2019-5-19 16:53:55] [Broadlink] Klimaanlage Paul addTemperatureCallbackToQueue (requested temperature from device, waiting)
Mai 19 16:53:56 homebridge homebridge[21414]: [2019-5-19 16:53:56] [Broadlink] Klimaanlage Schlafzimmer onTemperature (20.6)
Mai 19 16:53:56 homebridge homebridge[21414]: [2019-5-19 16:53:56] [Broadlink] Klimaanlage Esszimmer onTemperature (22)
Mai 19 16:53:56 homebridge homebridge[21414]: [2019-5-19 16:53:56] [Broadlink] Klimaanlage Emil onTemperature (22.9)
Mai 19 16:53:56 homebridge homebridge[21414]: [2019-5-19 16:53:56] [Broadlink] Klimaanlage Paul onTemperature (22.7)
Mai 19 16:54:01 homebridge homebridge[21414]: [2019-5-19 16:54:01] [Config] Console v4.4.2 is listening on :: port 8030
Mai 19 16:54:05 homebridge homebridge[21414]: [2019-5-19 16:54:05] [Config] Multiple Instances Of Homebridge Found Installed
Mai 19 16:54:05 homebridge homebridge[21414]: [2019-5-19 16:54:05] [Config] /usr/local/lib/node_modules/homebridge
Mai 19 16:54:05 homebridge homebridge[21414]: [2019-5-19 16:54:05] [Config] /usr/lib/node_modules/homebridge
Mai 19 16:55:03 homebridge homebridge[21414]: [2019-5-19 16:55:03] [homebridge-config-ui-x] SyntaxError: Unexpected token %

@oznu
Copy link
Member

oznu commented May 20, 2019

No change. Are you able to trigger this log from any particular action in the UI?

@marcoschmidt79
Copy link
Author

Sorry for my bad english.

I restart instance 1, go to UI from instance 1 and everything ok. I restart instance 2, i open the UI from instance 2 and ok. i open the UI from instance 1 and the screen from browser is white and the log from instance 1 say: SyntaxError: Unexpected token %

@Shana611
Copy link

I have the same problem after updating to the new version

@yungeconomist
Copy link

Same issue: here's some log output from my setup
`[5/22/2019, 10:29:38 AM] Homebridge is running on port XXXX.
�[0;37m[5/22/2019, 10:29:39 AM] �[0m�[0;36m[Config]�[0m �[0;33mConsole v4.4.2 is listening on 0.0.0.0 port XXXXX�[0m
[5/22/2019, 11:00:44 AM] �[36m[homebridge-config-ui-x]�[0m �[31mSyntaxError: Unexpected token %�[0m
[5/22/2019, 11:00:44 AM] �[36m[homebridge-config-ui-x]�[0m �[31mSyntaxError: Unexpected token %�[0m

/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:22227
flatstr(payload)
^
SyntaxError: Unexpected token %
at preserializeHookEnd (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:22227:3)
at preserializeHook (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:22216:5)
at _Reply.Reply.send (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:22115:5)
at PassThrough.flush [as _flush] (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:73169:17)
at PassThrough.prefinish (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:34606:10)
at PassThrough.emit (events.js:196:13)
at prefinish (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:34395:14)
at finishMaybe (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:34404:5)
at endWritable (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:34417:3)
at PassThrough.Writable.end (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:34355:22)
at SendStream.notModified (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:75462:7)
at SendStream.send (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:75720:12)
at onstat (/usr/lib/node_modules/homebridge-config-ui-x/dist/main.js:75812:10)
at FSReqCallback.oncomplete (fs.js:149:5)`

@hangmanandhide
Copy link

I just got this as well: [homebridge-config-ui-x] SyntaxError: Unexpected token %

after logging into the ui-x for the first time, I tried clickign plugins and it triggered that in terminal. I then tried to click config and it wouldn't let me. Clicking log seemed to work, although it was blank...

every other button on the menu seemed to throw the error as well -- except restart which gave
[homebridge-config-ui-x] SyntaxError: Unexpected token %

followed by 3 lines of the unexpected token % error...

@marcoschmidt79
Copy link
Author

yes, same problem, also with 4.4.3

@oznu
Copy link
Member

oznu commented May 29, 2019

I've not been able to figure this one out.

I got it once on a fresh Raspberry Pi install, but as soon as I added some trivial debug code and restarted I could not replicate the problem again, even after reinstalling and removing the debug code.

@marcoschmidt79
Copy link
Author

I've not been able to figure this one out.

I got it once on a fresh Raspberry Pi install, but as soon as I added some trivial debug code and restarted I could not replicate the problem again, even after reinstalling and removing the debug code.

How many instaces do you have? i think, this is a problem when you have more than one instances

@oznu
Copy link
Member

oznu commented May 29, 2019

One thing you might be able to try is added "debug": true to the UI config.

Then as a second test start Homebridge with the DEBUG=* environment variable. This is going to generate a lot of logs, so just post the bits around where the error occurs.

@marcoschmidt79
Copy link
Author

ok, i will do it on the next days and i post the logs :-)

@oznu
Copy link
Member

oznu commented May 30, 2019

I don't think multiple instances is the cause:

image

I setup 10 instances of homebridge running the config plugin on a Raspberry Pi 3 managed by systemd.

@oznu
Copy link
Member

oznu commented May 30, 2019

I've found the only function in the code base that was not logging it's error correctly (with a full stack trace). If you try 4.4.4 I think the error should be much more detailed.

@oznu
Copy link
Member

oznu commented May 30, 2019

Next thing to try...

npm install -g --unsafe-perm homebridge-config-ui-x@next

@marcoschmidt79
Copy link
Author

Next thing to try...

npm install -g --unsafe-perm homebridge-config-ui-x@next

Yes, thank you very much, the 4.4.5 beta 1 works fine without syntax error. :-D

@oznu
Copy link
Member

oznu commented Jun 2, 2019

I've published 4.4.5. You can upgrade from the beta version in-app.

@marcoschmidt79 - if there are still no problems feel free to close this issue 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants