Ask Your Question
1

Can't add external JavaScript library

asked 2018-09-26 15:36:09 -0500

kranthi gravatar image

updated 2018-10-11 18:09:56 -0500

metadaddy gravatar image

I am trying to add moment.js file (https://momentjs.com/). In my StreamSets pipeline, I have

load('file:///usr/lib/moment.min.js');

state.moment = require('moment');

I am following this blog post: https://streamsets.com/blog/calling-e...

I get the following validation error

validation error : SCRIPTING_08 - Script error while running init script: javax.script.ScriptException: ReferenceError: "require" is not defined in <eval> at line number 2
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-09-26 17:48:21 -0500

kranthi gravatar image

load('file:///usr/lib/moment.min.js') inside script just works fine..

var date = moment().format()

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-09-26 15:36:09 -0500

Seen: 17 times

Last updated: Oct 11