Question

I'm using Visualforce Remoting for an application, and periodically getting the error:

Uncaught TypeError: Cannot read property 'tid' of undefined, from line 84 of the VFRemote.js library file.

The file is auto-loaded into my page by my controller defining Remote Actions.

https://c.na4.visual.force.com/jslibrary/1383366200000/sfdc/VFRemote.js (I'm aware of the note at the top, but not including this script directly in my page.)

I'm not clear what's causing this. If I update my Application Cache Manifest, it will cue a refresh of the page, and then the error disappears.

Any thoughts? Is it a problem with the manifest?

No correct solution

OTHER TIPS

just want to confirm that I found @Sven's comment to be very helpful. I had the same 'tid' undefined issue and it was down to me stupidly passing in a undefined parameter to the RemoteAction

I encountered this error when I was using angular promises and batching calls. I needed to add:

{
    buffer: false, 
    escape: true, 
    timeout: 120000 
}

to all of my calls so that the remote manager wouldn't batch up the calls I wanted to be independent. The key setting being buffer: false.

It's been long sine this question has been posted but still writing in case any future readers. The key here is to add { buffer: false, escape: true, timeout: 30000 }

What this line does is it will not allow remote manager wouldn't to batch up the remoting calls. Why this is helpful because sometimes we just don't have data to pass to a remoting function when bootstrapping happens for JS code resulting in undefined objects being passed to remoting calls and thus the the above error.

Incase wondering where to add it:

scope.getParentId = function() {

        EsignCongaSigningUrlRemoting.getEsignUrlParentIdFromObjectId($scope.objectId, 1, function(response, event) {
            if(event.status) {
                console.log('parentId in response = ',response);
                $scope.parentId = response;
                $scope.signingUrl($scope.parentId);

            } 
            else {
                $scope.parentId = '';
            }   


        },{ buffer: false, escape: true, timeout: 30000 }); 

    };

The problem is that you have the Visualforce.remoting... method inside a static resource. For that line of code to work, it has to be in an apex page. You have to move the function that has that into your visual force page for it to work

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top