# V8 Custom Script + Later.js =?

**URL:** <https://community.dreamfactory.com/t/v8-custom-script-later-js/3028>\
**Category:** Server-Side Scripting\
**Created:** [July 28, 2016, 9:57am UTC](https://community.dreamfactory.com/t/v8-custom-script-later-js/3028 "2016-07-28T09:57:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prathamesh\_Gaddam](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@Prathamesh\_Gaddam](https://community.dreamfactory.com/u/Prathamesh_Gaddam)\
**Post date:** [July 28, 2016, 9:57am UTC](https://community.dreamfactory.com/t/v8-custom-script-later-js/3028/1 "2016-07-28T09:57:44Z")

</div>

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;
> 
> ```

---

<div class="post-metadata">

**Author:** ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)\
**Post date:** [July 29, 2016, 2:51pm UTC](https://community.dreamfactory.com/t/v8-custom-script-later-js/3028/2 "2016-07-29T14:51:08Z")

</div>

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?](https://community.dreamfactory.com/t/is-there-a-console-to-debug-server-side-scripts/429/8)

---

<div class="post-metadata">

**Author:** ![Prathamesh\_Gaddam](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@Prathamesh\_Gaddam](https://community.dreamfactory.com/u/Prathamesh_Gaddam)\
**Post date:** [July 31, 2016, 5:12pm UTC](https://community.dreamfactory.com/t/v8-custom-script-later-js/3028/3 "2016-07-31T17:12:00Z")

</div>

@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](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.
