mitchmason / MultilingualAssistant

Apache License 2.0
1 stars 4 forks source link

syntax error when running IdentifyTranslate.js #2

Open lee-zhg opened 3 years ago

lee-zhg commented 3 years ago

Tried to run code IdentifyTranslate.js for pre-webhook and received the error below:

ul 29 07:13:12 functions crn:v1:bluemix:public:functions:us-south:a/2c426324cc934f71a2a053c9185791ff::: {“error”:“Initialization has failed due to: SyntaxError: Invalid or unexpected token\n at initializeActionHandler (/nodejsAction/runner.js:63:80)\n at doInit (/nodejsAction/src/service.js:174:16)\n at initCode (/nodejsAction/src/service.js:93:24)\n at /nodejsAction/platform/platform.js:125:17\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at next (/node_modules/express/lib/router/route.js:137:13)\n at Route.dispatch (/node_modules/express/lib/router/route.js:112:3)\n at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)\n at /node_modules/express/lib/router/index.js:281:22\n at Function.process_params (/node_modules/express/lib/router/index.js:335:12)“}

lee-zhg commented 3 years ago

Weird invisible special characters caused the syntax errors. I got rid of the most of them except one. So, I had to remove it manually.

The code did not work even after removed the special characters. Code below is working on my system now. Thank you for the sample code.

BTW, I did not clone the repo. So, I won't create any pull request.

/*