TypeError: undefined is not a function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-08-2022 02:25 PM
We recently did a clone from Prod to Dev and before the clone happened the Flow Designer process was working just fine. Now after the clone the call to a script include in the Global scope is failing with the error "TypeError: undefined is not a function.". The script Include has Accessible from set to "All Application Scope". The statements making the call are as follows:-
XFC = new global.DTH_ImportAttUtil(); // This is where it is failing
XFC.importAtt(inputs.datasource);
I have checked out the scope privileges and compared to another similar class instantiation which works just fine but don't see anything glaring. Even checked the Runtime Access Tracking setting on the Scoped Application and it is set to "Enforcing". Re-cloning the instance is not an option. I have recreated the script include a dozen times but nothing seems to do it.
Any clues that would help me?
Thx
- Labels:
-
Integrations
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-09-2022 02:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-09-2022 07:03 AM
I have checked every word of the code and there is nothing that is amiss. I even tried creating a new script include with all the boxes checked ("All application scopes", "Client Callable") and it still does not work. Seems like I will have to drop the application and redo everything. This makes no sense at all because prior to cloning the instance the exact same code worked just fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-09-2022 02:03 PM
Does the application still exist in the sys_app table? I've also had issues when I was still doing dev on an app and after a clone I realized I had to pull it back down from source control since it wasn't installed in prod. Or things that pulled down from prod had to be reinstalled from source control because they pulled down as read only since it was installed from the my company apps repo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-09-2022 04:15 PM
Sadly this is a pretty generic error (TypeError: "x" is not a function). Here is some useful info from the javascript bible MDN that further explains why you might see this.
Although, you mentioned a clone. Here are some things that come to mind when I think of clones.
-- During cloning as a dev I have to pull out anything I'm working on in the lower environments, and then replace them back into the instance after the clone.
-- This is only a problem if I didn't capture what I think I did in my update set š and when the script include is run, it doesn't see a script/method at all or something.
-- Another one is if I have a typo somewhere from a different version in my update set.
Either way, it seems like when you call the Script Include JS doesn't know where to look because JS doesn't think it exists.