Stack Exchange
javascript evaluation failed when read javascript in karate
I am not able to identify why I am getting this javascript evaluation failed error.
function render(template, data) {
    var templatePath = template;
    console.log(templatePath);
    if(templatePath.indexOf('classpath:') !== -1) {
        templatePath = templatePath.substring('classpath:'.length);
    }
    var Renderer = Java.type('com.test.handlebars.Renderer');
    var renderer = new Renderer();
    var view = renderer.render(templatePath, karate.pretty(data));
    var result = JSON.parse(view);
    return result;
}

Background: 

url ABC
def render = read('classpath:com/test/karate/render.js')
def cy_tmp = 'classpath:api/template/cy.tmp'

Scenario: find all allowed instructions

Given path XYZ
def instruction = __arg['input'] ? __arg.input[0] : __arg.instruction;
And param Cd =instruction.Cd
def cyCd = render(cy_tmp, instruction)
And param ccyCd = cyCd
And param Amount = instruction.Amount
When method GET
Then status 200

I get the following error : 

javascript evaluation failed: render(cy_tmp, instruction)

I am using 

karate version 0.7.0.2 
jdk 1.8.0_144


the only suggestion I have is this: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
