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

Regular expression error when using brooker #253

Closed
Mr-Groch opened this issue Nov 11, 2019 · 4 comments
Closed

Regular expression error when using brooker #253

Mr-Groch opened this issue Nov 11, 2019 · 4 comments

Comments

@Mr-Groch
Copy link

Mr-Groch commented Nov 11, 2019

When I try to use broker, all requests ends with regular expression error:

Authentication succeeded
Broker processing phrase: 'switch to the polsat channel' (en)
request failed
route:  /broker
query:  { phrase: 'switch to the polsat channel' }
error:  SyntaxError: Invalid regular expression: /^play a random (?<genre>.+ )?movie( of year (?<year>\d+))?/: Invalid group
    at String.match (native)
    at exports.processRequest (/volume1/homes/groch/GoogleHomeKodi/broker.js:23:28)
    at /volume1/homes/groch/GoogleHomeKodi/server.js:45:9
    at Layer.handle [as handle_request] (/volume1/homes/groch/GoogleHomeKodi/node_modules/express/lib/router/layer.js:95:5)
    at next (/volume1/homes/groch/GoogleHomeKodi/node_modules/express/lib/router/route.js:137:13)
    at next (/volume1/homes/groch/GoogleHomeKodi/node_modules/express/lib/router/route.js:131:14)
    at next (/volume1/homes/groch/GoogleHomeKodi/node_modules/express/lib/router/route.js:131:14)
    at next (/volume1/homes/groch/GoogleHomeKodi/node_modules/express/lib/router/route.js:131:14)
    at next (/volume1/homes/groch/GoogleHomeKodi/node_modules/express/lib/router/route.js:131:14)
    at next (/volume1/homes/groch/GoogleHomeKodi/node_modules/express/lib/router/route.js:131:14)
body:  { token: '***' }
Sending command to kodi http://***.lan:8008/jsonrpc:
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "GUI.ShowNotification",
  "params": {
    "title": "GoogleHomeKodi",
    "message": "undefined: Invalid regular expression: /^play a random (?<genre>.+ )?movie( of year (?<year>\\d+))?/: Invalid group",
    "image": "error"
  }
}

When I deleted first item from en.json then error occurs on next... and so on...

@keydon
Copy link
Collaborator

keydon commented Nov 12, 2019

You seem to use a pretty old nodejs version (9 or older), but you need 10 or higher for the broker to work.

keydon added a commit that referenced this issue Nov 12, 2019
For quicker reproduction of version specific errors like
#253
@Mr-Groch
Copy link
Author

OK, thanks, yous should update readme, in B.2, there is:

B.2 Set up local webserver (Click to expand instructions)
Install the Node.js application server on your target computer
Note: Required Version is 6.10 or above (8 preferred)

Unfortunately on Synology node v8 is the latest available...

@keydon
Copy link
Collaborator

keydon commented Nov 12, 2019

yeah good point, I will update the readme.

And as I gather from #255 you can code. So the problem with node v8 is the regex feature of named groups. You could rewrite the en.json to use anonymous groups and adjust the code thats reading the match. At least the commands which only use the q parameter would then work.

@keydon
Copy link
Collaborator

keydon commented Nov 13, 2019

Readme updated.
Ah and if you have a x86 synology model you might wanna try the docker hosting solution.

@keydon keydon closed this as completed Nov 13, 2019
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

2 participants