简体   繁体   中英

Plenty of Uncaught (in promise) DOMException errors in simple Vue.js app

I'm developing simple Vue.js application as a learning project using Vue.js, Quasar and Vuex. For some unknown (to me) reason I'm getting lots of Uncaught (in promise) DOMException errors. The application works just fine, but those red errors don't seem right. How can I debug and fix these?

While refreshing website, errors show up in console right away. I think it's even before app itself is fully loaded:

控制台截图

Each error takes form of:

Uncaught (in promise) DOMException    service-worker.js:1

Promise.then (async)
(anonymous)         @ workbox-strategies.dev.js:681
step                @ workbox-core.dev.js:14
(anonymous)         @ workbox-core.dev.js:25
Promise.then (async)
step                @ workbox-core.dev.js:24
(anonymous)         @ workbox-core.dev.js:32
(anonymous)         @ workbox-core.dev.js:11
_getNetworkPromise  @ workbox-strategies.dev.js:691
(anonymous)         @ workbox-strategies.dev.js:554
step                @ workbox-core.dev.js:14
(anonymous)         @ workbox-core.dev.js:32
(anonymous)         @ workbox-core.dev.js:11
makeRequest         @ workbox-strategies.dev.js:578
(anonymous)         @ workbox-strategies.dev.js:504
step                @ workbox-core.dev.js:14
(anonymous)         @ workbox-core.dev.js:32
(anonymous)         @ workbox-core.dev.js:11
handle              @ workbox-strategies.dev.js:508
handleRequest       @ workbox-routing.dev.js:365
(anonymous)         @ workbox-routing.dev.js:835

Clearing cache and hard reloading site doesn't work.

I am starting the app via npm run dev script.

Whole code is available on BitBucket repository

As Ohgodwhy suggested, the source of the problem was some old service worker installed on my domain (in this case simply localhost ). The idea is to remove it.

To remove service worker in Chrome browser:

  1. Open developer tools in your browser ( F12 or command + option + i )
  2. Head to Application tab
  3. Go to Service Workers section
  4. Click Unregister on service worker that could be broken

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM