V8 Custom Script + Later.js =?

Hi,

Build a V8js custom service with later.js to have cron as services. However, following snippet throws error 'Array to string conversion'. Any way to validate/troubleshoot if required js file is loaded. Or library issue

The later.min.js file is copied/available at \Bitnami\dreamfactory-2.1.0-4\apps\dreamfactory\htdocs\storage\scripting\

Code Snippet:

var lodash = require("lodash.min.js");
var _later = require("later.min.js");
var sched = later.parse.cron('15 10 ? * *');
var dates = later.schedule(sched).next(5);
var result = {};
result.phase = 'testing';
result._later = _later;
result.sched = sched;
result.dates = dates;
return result;

I’m not really familiar with later.js, but you could use console logging to dump your debug points to the dreamfactory log. Is there a console to debug server side scripts?

1 Like

@drewpearce thank you for the reply. From dreamfactory.log, found no stack-trace nor from Apache server logs. Any dev docs as how the custom js file in V8js scripts works with DF. Referred https://wiki.dreamfactory.com/DreamFactory/Features/Scripting/V8Js , however not much details on how to load third party lib/js …from source understanding as it used requirejs.