Criteo ID Module: Missing error callback for ajax() cause "g.error is not a function"
Type of issue
Bug. Likely no relevant effect aside from message on browser console
Description
My js bug reporting sees some of these events for real users:
TypeError: g.error is not a function
According to the available stacktrace it's caused src/ajax.js here:
callbacks.error(x.statusText, x);
for some unknown Network reason.
I've found at least one module from my list that uses an ajax() call with an object as argument but only a success callback which is probably the root cause: criteoIdSystem.
I don't know if the module is violating the intended API or if the ajax() call should check if that error callback is available.
Expected results
Handle network error with some simple log entry
Actual results
Uncaught javascript error
Platform details
Prebid 7.35.0 unknown bundle details.
@tbsmark86 can you please add a test page for this issue?
I don't know what you expect as a test page and I don't know how to configure prebid myself. I've just traced the error appearing in my sentry.io-style-tool back to this.
Wild guess for a test case:
import { ajax } from '../src/ajax.js';
ajax(
'http://some-url-that-will-always-fail.org/'
{
success: response => { console.log('imposible'); }
// note missing error callback
},
undefined,
{ method: 'GET', withCredentials: true }
);
That's somewhat copy&paste from modules/criteoIdSystem.js ~ line 95
@allanjun could you take a look?
Hello @patmmccann We've logged the issue internally & we'll push a PR to fix it later this week
fixed via https://github.com/prebid/Prebid.js/pull/9754