# js uploaded in Design Manager returns Uncaught SyntaxError

**URL:** <https://community.hubspot.com/t/js-uploaded-in-design-manager-returns-uncaught-syntaxerror/73248>\
**Category:** CMS Development\
**Tags:** javascript\
**Created:** [January 19, 2023, 2:49am UTC](https://community.hubspot.com/t/js-uploaded-in-design-manager-returns-uncaught-syntaxerror/73248 "2023-01-19T02:49:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsantos1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gsantos1/32/61905_2.png) [@gsantos1](https://community.hubspot.com/u/gsantos1)\
**Post date:** [January 19, 2023, 2:49am UTC](https://community.hubspot.com/t/js-uploaded-in-design-manager-returns-uncaught-syntaxerror/73248/1 "2023-01-19T02:49:01Z")

</div>

Hello

I’m trying to solve this for sometime now.

I uploaded the fancybox.umd.js on my site template folder in Design Manager. I tried to load with 2 different methods, both return the same error:

{{ require\_js(get\_asset\_url(“/THEMENAME/js/fancybox.umd.js”)) }}

or

\<script src=“{{ get\_asset\_url(‘/THEMENAME/js/fancybox.umd.js’) }}”\>\</script\>

Uncaught SyntaxError: unexpected token: ‘)’

It only works loading from fancybox CDN, but I want to avoid add another domain to the site loading because of performance, so I need to load from my domain.

Has you seen this before?

---

<div class="post-metadata">

**Author:** ![Syeda\_Fatima](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/syeda_fatima/32/36951_2.png) [@Syeda\_Fatima](https://community.hubspot.com/u/Syeda_Fatima)\
**Post date:** [January 19, 2023, 6:59am UTC](https://community.hubspot.com/t/js-uploaded-in-design-manager-returns-uncaught-syntaxerror/73248/2 "2023-01-19T06:59:16Z")

</div>

Hey @gsantos1 yes, and I would suggest you to try loading the script with the async attribute set to true. This will allow the script to load without blocking the rest of the page.

\<script src=“{{ get\_asset\_url(‘/THEMENAME/js/fancybox.umd.js’) }}” async\>\</script\>

---

<div class="post-metadata">

**Author:** ![gsantos1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/gsantos1/32/61905_2.png) [@gsantos1](https://community.hubspot.com/u/gsantos1)\
**Post date:** [January 19, 2023, 7:07am UTC](https://community.hubspot.com/t/js-uploaded-in-design-manager-returns-uncaught-syntaxerror/73248/3 "2023-01-19T07:07:23Z")

</div>

Hi [@Syeda\_Fatima](https://community.hubspot.com/t5/user/viewprofilepage/user-id/114957)

I had async there before, I removed to make the line as simple as possible trying to solve the issue, no success.

Even if I use the full URL from my theme instead of get\_asset\_url, the issue persist.

Uncaught SyntaxError: unexpected token: ‘)’

and the same file loading from outside Hubspot, loads fine.

Maybe is something to do with the minifying process on Hubspot?

---

<div class="post-metadata">

**Author:** ![Syeda\_Fatima](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/syeda_fatima/32/36951_2.png) [@Syeda\_Fatima](https://community.hubspot.com/u/Syeda_Fatima)\
**Post date:** [January 19, 2023, 7:18am UTC](https://community.hubspot.com/t/js-uploaded-in-design-manager-returns-uncaught-syntaxerror/73248/4 "2023-01-19T07:18:19Z")

</div>

Dear @gsantos1, I’m not sure what is causing the issue. It could be related to the minifying process, or it could be related to the way the file is being loaded.

However, You could try loading the file directly from your theme instead of using the get\_\*\*bleep\*\*et\_url() function to see if that makes any difference.

And also, you could try debugging the code to see why the syntax error is being thrown.
