A compatibility issue with Workbox versions is causing an error in Google Chrome when using Discourse version 3.1.0.beta5. The error is not present in Firefox or older versions of Discourse.
ShaoJie encountered the issue and provided logs and screenshots. Lilly and JammyDodger were unable to reproduce the issue, but Canapin was able to reproduce it using a Chromium-based browser.
The error message is:
Uncaught TypeError: workbox.cachableResponse.Plugin is not a constructor
ShaoJie suggested that the issue may cause problems with caching resources correctly. ShaoJie also proposed a solution, replacing workbox.cacheableResponse.Plugin with workbox.cacheableResponse.CacheableResponsePlugin.
It seems to be a Workbox version compatibility issue. I didn’t encounter any errors while using Firefox, but it appears to be happening only for me on Google Chrome. I have deployed both an older version (3.1.0.beta2) and the latest version (3.1.0.beta5) of Discourse, and the error only occurs in version 3.1.0.beta5 when using Google Chrome.
I use Chrome on my Mac, which is already the latest version, and I have tried clearing the cache. The error still persists, but it’s possible that this error is only happening locally on my computer.
yep!I did some research and it seems that replacing workbox.cacheableResponse.Plugin with workbox.cacheableResponse.CacheableResponsePlugin might be a possible solution.