2013 – SP.UI.ModalDialog.showWaitScreenWithNoClose TypeError: a.indexOf is not a function

I’m getting TypeError: a.indexOf is not a function when calling showWaitScreenWithNoClose().

I’m trying to wait until all necessary scripts are loaded, my code is essentially:

$(document).ready(() => {
    SP.SOD.executeFunc('sp.js', 'SP.ClientContext', () => {
        SP.SOD.executeFunc('sp.ui.dialog.js', 'SP.UI.ModalDialog', () => {
            var waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Working on it...');
            // do stuff, then later:

When my browser dev tools pause on the exception, you can see what a is, in the scope:

screen shot of browser dev tools

Anyone have any idea what’s going wrong there and how I can fix it?

It doesn’t seem to really be breaking anything, the wait dialog shows and closes fine, it’s just that it’s annoying during development to have the dev tools pause on that error every time I reload the page.