Call JavaScript Library in Widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 10:12 AM - edited 08-17-2023 10:12 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 10:16 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 10:19 AM
Thanks Maik.
I've tried this but I'm still faced with the same issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 10:28 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 10:33 AM
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?