# Error adding external JavaScript library

**URL:** <https://community.dreamfactory.com/t/error-adding-external-javascript-library/2388>\
**Category:** Server-Side Scripting\
**Created:** [March 22, 2016, 7:03am UTC](https://community.dreamfactory.com/t/error-adding-external-javascript-library/2388 "2016-03-22T07:03:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@Nikhil](https://community.dreamfactory.com/u/Nikhil)\
**Post date:** [March 22, 2016, 7:03am UTC](https://community.dreamfactory.com/t/error-adding-external-javascript-library/2388/1 "2016-03-22T07:03:16Z")

</div>

Hi,  
I am trying to add an external JavaScript library (md5.js) in my custom script using require(""). When I run that, I get “Array to string conversion” error. But when I remove the require statement and run, it works fine.

Thanks in advance for the help.

---

<div class="post-metadata">

**Author:** ![toddappleton](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/toddappleton/32/159_2.png) [@toddappleton](https://community.dreamfactory.com/u/toddappleton)\
**Post date:** [March 22, 2016, 1:07pm UTC](https://community.dreamfactory.com/t/error-adding-external-javascript-library/2388/2 "2016-03-22T13:07:12Z")

</div>

Is this a V8js or Node.js script? For V8js you have to put that md5.js file in the storage/scripting directory. The permissions should match the other files in /scripting (664). Fore Node.js you would use require(“md5”). Just the package name, no ‘.js’ on the end.

---

<div class="post-metadata">

**Author:** ![Nikhil](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@Nikhil](https://community.dreamfactory.com/u/Nikhil)\
**Post date:** [March 23, 2016, 5:10am UTC](https://community.dreamfactory.com/t/error-adding-external-javascript-library/2388/3 "2016-03-23T05:10:46Z")

</div>

It is in V8js. I am using Dream Factory in windows and placed the md5.js file in “C:\Bitnami\dreamfactory-2.1.0-4\apps\dreamfactory\htdocs\storage\scripting” folder. I checked for the permissions and for both the files the permissions are matching. Still I am getting the same error. Please help.

---

<div class="post-metadata">

**Author:** ![toddappleton](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/toddappleton/32/159_2.png) [@toddappleton](https://community.dreamfactory.com/u/toddappleton)\
**Post date:** [March 23, 2016, 12:42pm UTC](https://community.dreamfactory.com/t/error-adding-external-javascript-library/2388/4 "2016-03-23T12:42:07Z")

</div>

Anything in the log file under storage/logs? In htdocs/.env set APP\_DEBUG=true and DF\_LOG\_LEVEL=DEBUG then try your script.
