Why can't you use it as a custom module, like mome...
# suitescript
r
Why can't you use it as a custom module, like moment?
j
When you upload a client script or add one to a form using
form.clientScriptModule(Id/Path)
the NetSuite server statically analyzes and all the dependencies imported in the
define
array
. The SweetAlert library uses
WeakMap
which is a newer JS API that is supported in most browsers but is not recognized by the server, so the server rejects any client script that imports it using
define
.
An easy workaround is to import the library using
require
instead of
define