sample-media-pwa
sample-media-pwa copied to clipboard
This is not defined
I got this error when starting the application
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?