Hi Team,
I am getting
“Failed to load tracker data from localStorage”,
this error from js-tracker v2.8 on stream-collector logs
What is this and how it can be resolved?
Hi Team,
I am getting
“Failed to load tracker data from localStorage”,
this error from js-tracker v2.8 on stream-collector logs
What is this and how it can be resolved?
Where is this error being raised - is it from the tracker itself? If so where in the tracker code is it being raised?
object.OutQueueManager = function (functionName, namespace, mutSnowplowState, useLocalStorage, usePost, bufferSize, maxPostBytes) {
var queueName,
executingQueue = false,
configCollectorUrl,
outQueue;
// Fall back to GET for browsers which don't support CORS XMLHttpRequests (e.g. IE <= 9)
usePost = usePost && window.XMLHttpRequest && ('withCredentials' in new XMLHttpRequest());
var path = usePost ? '/com.xyz.streams/tp2' : '/i';
bufferSize = (localStorageAccessible() && useLocalStorage && usePost && bufferSize) || 1;
// Different queue names for GET and POST since they are stored differently
queueName = ['snowplowOutQueue', functionName, namespace, usePost ? 'post2' : 'get'].join('_');
if (useLocalStorage) {
// Catch any JSON parse errors or localStorage that might be thrown
try {
// TODO: backward compatibility with the old version of the queue for POST requests
outQueue = JSON.parse(localStorage.getItem(queueName));
}
catch(e) {
trackerFailed.logTrackerFailure('Failed to load tracker data from localStorage', e);
}
}
In this code snippet:
outQueue = JSON.parse(localStorage.getItem(queueName));
this is the exception that is causing