We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Call JavaScript Library in Widget

Asim7
Tera Contributor

Hi,

 

I'm using a JS Include in my portal theme but I'm getting this error:

 

 

Uncaught SyntaxError: Cannot use import statement outside a module

 

 

Does anyone know how we can fix this error?

 

Thanks,

Asim

 

 

4 REPLIES 4

Maik Skoddow
Tera Patron

Hi

the following article explains how to leverage 3rd party libraries in a service portal: https://www.servicenow.com/community/developer-articles/service-portal-dependencies-adding-3rd-party...

Maik

Thanks Maik.

 

I've tried this but I'm still faced with the same issue.

Unfortunately, you do not provide any more details for a better answer. But in case in the external JS library an import statement is used, it will probably not work in the ServiceNow context.

What else do I need to provide?

 

So if I understand correctly, if in the JavaScript library import statement is being used, ServiceNow isn't able to make it work?