JS Evaluate - Load JS script from File - encoding issue?

Discuss RoboTask here

JS Evaluate - Load JS script from File - encoding issue?

Postby juanlu » Mon Jul 20, 2020 3:49 pm

Hi Oleg,

We are trying to use the functionality to load a js file in a JS Evaluate action. So far we haven't been successful.

We are already using the JS Evaluate action today, either using a simple js statement directly in the field "Expression to evaluate" or adding a script with "Use Internal Script". But now we are trying to use "Load JS script from File" and it doesn't seem to work.

RoboTask finds the file and can access it: if we leave the file empty or the variable in the "Expression to evaluate" is not present in the script, RoboTask shows the corresponding error message. But it seems to be an encoding issue (we have tried UTF8, UTF8-BOM, UTF16, ANSII windows-1252, ANSII ISO-8859-1); even a file containing just containing var dummy="helloworld"; can't be read correctly. The generic error that we get is Error: Line number 1 (1) Invalid symbol

What can we do to read a simple js file?

Kind regards, Juanlu.
juanlu
 
Posts: 28
Joined: Wed Jul 31, 2019 12:33 am

Re: JS Evaluate - Load JS script from File - encoding issue?

Postby juanlu » Tue Jul 21, 2020 9:28 am

Furthermore, I duplicated the demo task "JS Evaluate demo" (https://robotask.com/tasks/Demo/%5BDEMO ... 20demo.tsk). I changed it by copying the JS code in the "Use Internal Script" to an external js file. Then I changed from "Use Internal Script" to "Load JS script From File".

Same issue:
"Line number 1 (7), Invalid character"
"Erro is in additional functions"
juanlu
 
Posts: 28
Joined: Wed Jul 31, 2019 12:33 am

Re: JS Evaluate - Load JS script from File - encoding issue?

Postby Oleg » Tue Jul 21, 2020 10:16 am

This is a bug, sorry.
We'll fix it and release the patch ASAP
Oleg Yershov
Oleg
Site Admin
 
Posts: 2586
Joined: Thu Jan 01, 1970 1:00 am

Re: JS Evaluate - Load JS script from File - encoding issue?

Postby juanlu » Tue Jul 21, 2020 11:18 am

Oleg, thanks for the prompt reply and for the feedback.
juanlu
 
Posts: 28
Joined: Wed Jul 31, 2019 12:33 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 30 guests

cron