Hi Robert,
I created new onScreen widget 'MapExport' and in widget.js file, I'm calling _isEnableExport function from startup function if the isenable parmater is "export" from the URL(https://machinename:port/webappbuilder/apps/xx/?isenable=export).
_isEnableExport function has the code which you have shared.
Screenshots of widget.js file of MapExport widget and Error are attached below.
Getting this error after sometime once the widget is created.
Widget.js file of MapExport widget.


Error:



