Trusted Contributor.. CR Trusted Contributor..
Trusted Contributor..
132 views

Unexpected end of JSON input when running a script

Jump to solution

Dear all,

I'm experiencing a weird error when running a script(TruClient Protocol,) using controller. it happens randomly at different points within the script whereas when I run it using the "develop script" it runs smoothly. 

for instance it happens often at the beginning when I load .js.file

t=00080746ms: ** Coded line #39: Start executing file \\VM01\TruClient\Start.js [MsgId: MMSG-205180]

t=00080746ms: Error -205177: Step 1: Run Coded script "CodedActions\\Action.js" failed - Runtime error in the script: SyntaxError: Unexpected end of JSON input [MsgId: MERR-205177]

 

I recently moved to 12.60 and I didn't experienced it with previous version. I've tried several changes but I'm now wondering if it can be the version maybe some patches to install. Do you have any idea?

Thanks

CR

0 Likes
1 Solution

Accepted Solutions
Outstanding Contributor.. lb1 Outstanding Contributor..
Outstanding Contributor..

Re: Unexpected end of JSON input when running a script

Jump to solution

Hi CR,

what browser are you using with TruClient? I think it's a CORS security issue: Chrome and IE Edge support this mechanism, and Firefox security's policies are complex. I suggest you to try IE browser from TruClient, and use JavaScript on your navigation to send a prelight request to the server before forward the original POST message in JSON. 

Have you tried with IE? If not, I suggest you to put a "Evaluate JS on Object" and declare an HXLHttpRequest() variable, so use setRequestHeader("Content-Type", "application/x-www-form-urlencoded") to force the type for CORS protocol and then use send("XML=prelightMessage") to dispatch it. 

Lorenzo

0 Likes
2 Replies
Outstanding Contributor.. lb1 Outstanding Contributor..
Outstanding Contributor..

Re: Unexpected end of JSON input when running a script

Jump to solution

Hi CR,

what browser are you using with TruClient? I think it's a CORS security issue: Chrome and IE Edge support this mechanism, and Firefox security's policies are complex. I suggest you to try IE browser from TruClient, and use JavaScript on your navigation to send a prelight request to the server before forward the original POST message in JSON. 

Have you tried with IE? If not, I suggest you to put a "Evaluate JS on Object" and declare an HXLHttpRequest() variable, so use setRequestHeader("Content-Type", "application/x-www-form-urlencoded") to force the type for CORS protocol and then use send("XML=prelightMessage") to dispatch it. 

Lorenzo

0 Likes
Highlighted
Trusted Contributor.. CR Trusted Contributor..
Trusted Contributor..

Re: Unexpected end of JSON input when running a script

Jump to solution

Hi Lorenzo,

I've tried IE browser instead of firefox and it seems the issue has disappeared.

Thanks for the support

Christian 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.