sample-media-pwa icon indicating copy to clipboard operation
sample-media-pwa copied to clipboard

This is not defined

Open hblab-huongdv opened this issue 5 years ago • 1 comments

I got this error when starting the application

error

hblab-huongdv avatar Jul 01 '19 10:07 hblab-huongdv

Somehow the arrow functions are not supoprted.

If you change this:

  _enableAllLinks () {
    const links = document.querySelectorAll('.js-item-link');

    Array.from(links).forEach(link => {
      link.classList.remove('item--disabled');
      link.removeEventListener('click', this._cancel);
    });

    return Promise.resolve();
  }

With this:

_enableAllLinks () {
    const links = document.querySelectorAll('.js-item-link');

    const linksArray = Array.from(links);
    for( let link of linksArray ) {
      link.removeEventListener('click', this._offlineCache._cancel);
    }

    return Promise.resolve();
  }

The error will disappear. Unfortunately you should change all the arrow functions.

I think this is a problem of configurations, for example, what version of NodeJS was used in this project? There are some global npm libraries that we should install?

scailbc avatar Dec 20 '19 17:12 scailbc