So it looks like the File Drag & Drop Bundle h...
# suitescript
a
So it looks like the File Drag & Drop Bundle has a script that is triggering the warning message about the Ext JS Library. Any ideas other than undeploying the thing? The script is locked since it is from a bundle, and the bundle is up to date.
a
1. undeploy it wholesale 2. selectively undeploy it from certain records to minimise errors shown but still keep it availble for record types that you use DnD a lot? 3. ignore the error messages, I don't think anything is broken yet right? its just warning it WILL break in the future?
TLDR - there's not really anything you can do
t
Thanks for calling that out, I didn't research it yet.
a
Yeah. I just hate telling clients "Not much I can do lol" Selectively un-deploying it might be the way to go. Hopefully the Bundle Author gets with the updates soon.
b
Copy code
window.libloader = function () {
  function f(a) {
    const b = a.name;
    if (e[b]) throw Error(`libloader - "${ b }" is allready loading`);
    'Ext' === b &&
    Object.assign(
      a,
      {
        beforeLoad: () => !Error().stack.match(/\/ext-all[\w.\-]*\.js/),
        afterLoad: c => {
          showAlertBox(
            'Ext_warning',
            'This page loads a script that uses the unsupported Ext JS library ',
            'The Ext JS library will be removed in NetSuite 2025.1. To prepare for this removal, you need to do one of the following: <br/> <br/>• Adjust your code to work without the use of the Ext JS library.<br/>• If you want to continue using the Ext JS library, you must replace it with your own external instance of the library.',
            2
          );
          'complete' === document.readyState &&
          c.env.Ready.handleReady()
        }
      }
    );
    e[b] = new g(a)
  }
  const d = Object.freeze({
    NOT_LOADED: 0,
    LOADING: 1,
    LOADED: 2
  });
  class g {
    constructor(a) {
      this.name = a.name;
      this.scripts = a.scripts;
      this.stylesheets = a.stylesheets;
      this.loadedSheets = [];
      this.nonce = a.nonce;
      this.value = null;
      this.loaderInitedLoad = !1;
      this.state = d.NOT_LOADED;
      this.beforeLoad = a.beforeLoad ?? (() => !0);
      this.afterLoad = a.afterLoad ?? (() => {
      });
      this.prepareOnDemandLoad()
    }
    loadSheets() {
      const a = document.head.firstChild;
      this.loadedSheets = this.stylesheets.map(
        b => {
          const c = document.createElement('link');
          c.rel = 'stylesheet';
          c.type = 'text/css';
          c.href = b;
          c.nonce = this.nonce;
          document.head.insertBefore(c, a);
          return c
        }
      )
    }
    unloadSheets() {
      this.loadedSheets.forEach(a => {
        a.parentNode.removeChild(a)
      });
      this.loadedSheets = []
    }
    loadScripts() {
      for (const a of this.scripts) {
        const b = new XMLHttpRequest;
        b.open('GET', a, !1);
        b.onreadystatechange = () => {
          4 === b.readyState &&
          (
            new Function(b.responseText + `
window.${ this.name }=${ this.name };`)
          ).call(window)
        };
        b.send(null)
      }
    }
    prepareOnDemandLoad() {
      this.loadSheets();
      Object.defineProperty(
        window,
        this.name,
        {
          get: () => {
            this.state === d.NOT_LOADED &&
            this.beforeLoad() &&
            (
              this.state = d.LOADING,
              this.loaderInitedLoad = !0,
              this.logLoad(),
              this.loadScripts(),
              this.afterLoad(this.value)
            );
            return this.value
          },
          set: a => {
            this.value = a;
            this.loaderInitedLoad ||
            this.unloadSheets();
            this.state = d.LOADED
          }
        }
      )
    }
    logLoad() {
      var a = `Dynamic load of "${ this.name }"`,
      b = Error().stack;
      a = {
        isError: !1,
        description: a,
        detail: JSON.stringify({
          time: (new Date).toISOString(),
          title: a,
          stack: b,
          url: window.location.href
        }),
        url: window.location.href,
        stack: b
      };
      a = 'messages=' + encodeURIComponent(JSON.stringify([a]));
      b = new XMLHttpRequest;
      b.open('POST', '/core/ui/log/errordbreporter.nl', !0);
      b.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
      b.send(a)
    }
  }
  const e = {};
  f.isLoaded = function (a) {
    return e[a] ? e[a].state === d.LOADED : !!window[a]
  };
  return f
}();
//# sourceMappingURL=/assets/ui_libloader/2370206760.map
is the code used to poison the Ext global
with the important parts being that its implemented as a getter on window.Ext
Copy code
get: () => {
            this.state === d.NOT_LOADED &&
            this.beforeLoad() &&
            (
              this.state = d.LOADING,
              this.loaderInitedLoad = !0,
              this.logLoad(),
              this.loadScripts(),
              this.afterLoad(this.value)
            );
            return this.value
          },
that is is only triggered when
Copy code
this.state === d.NOT_LOADED
and once triggered,
Copy code
this.state = d.LOADING,
meaning that there is a way to disable it, and in fact, it disables itself after running once
since you only need to fix it once, you can deploy your own client script that removes the alert via dom manipulation
and you only need to do it once, you wont need to do it after every use of the Ext global
if you are having timing problems and you dont want to deal with the alert briefly showing, you can temporarily disable the mechanism that shows the alert, get Ext, and then undisable it before other scripts get a chance to use Ext
for that solution, you would need to know how the afterLoad works
Copy code
afterLoad: c => {
          showAlertBox(
            'Ext_warning',
            'This page loads a script that uses the unsupported Ext JS library ',
            'The Ext JS library will be removed in NetSuite 2025.1. To prepare for this removal, you need to do one of the following: <br/> <br/>• Adjust your code to work without the use of the Ext JS library.<br/>• If you want to continue using the Ext JS library, you must replace it with your own external instance of the library.',
            2
          );
          'complete' === document.readyState &&
          c.env.Ready.handleReady()
        }
the obvious function to temporarily disable would be
showAlertBox
a
Appreciate that. Thank you