'TypeError: window.preload.local is undefined

I started working on a legacy project developed with ReactJS v16, Redux4.x, Node v10.24 and NPM v6.x.

I've been having a lot of trouble setting this up and running, but now a new issue appeared and I just can't figure out what to do:

Uncaught TypeError: window.preload.local is undefined
    Comunas Comunas.js:17

After diving into the project's files I found the following React Component:

const Comunas = ({ ...props }) => (
  <ExField type="select" {...props}>

    <option value="">Selecciona una Comuna...</option>

    {window.preload.local.map(local => (
      <optgroup key={local.RegionID} label={local.Name}>
        {local.provincias.map(provincia => (
          <React.Fragment key={provincia.ProvinciaID}>
            {provincia.comunas.map(comuna => (
              <option key={comuna.ComunaID} value={comuna.ComunaID}>
                {comuna.Name}
              </option>
            ))}
          </React.Fragment>
        ))}
      </optgroup>
    ))}

  </ExField>
);

Comunas.propTypes = {};

const mapStateToProps = createStructuredSelector({});

const withConnect = connect(
  mapStateToProps,
  () => ({}),
);

I've never seen window.preload (line 6) before.

Does anybody know where can I find information about that window's property?

Thank you very much in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source