next-pwa
next-pwa copied to clipboard
Uncaught ReferenceError: regeneratorRuntime is not defined
Summary
This is the issue https://github.com/GoogleChrome/workbox/issues/2493
How To Reproduce
- Copy the
examples/offline-fallback/service-worker.js
file into theexamples/custom-worker/worker
folder. - Require the copied file in the
examples/custom-worker/worker/index.js
—require("./custom-worker");
. - Run the
custom-worker
example, the error should appear in the service worker console.
P.S.: The offline-fallback
examples works, but it uses swSrc
to add the worker.
The reason of the bug is probably the ./worker/index.js
transpilation in the next-pwa/index.js
which doesn't handle the regeneratorRuntime
issue.
Expected Behaviors
Preferably the bug should be handled, but in any case I would expect that the transpilation of the ./worker/index.js
and the swSrc
worker is the same.
Additional Context
It was really hard to find the reason of the bug's origin, why it happens in next-pwa, or is it next-pwa problem or next.js problem, try the different examples, try different setups with my own code, etc. You got the idea. That's why I think the way to go is to make sure the transpilation is the same for all the cases (swSrc
and worker
and even the default service worker creation), so the surface for bugs breeding is smaller. 🐛 🐛 🐛
Could someone help with a minimal error reproduce repository?
The described steps do not reproduce the error anymore?
@mycolaos I still couldn't reproduce the error, it would be nice if I could have a setup repository to trouble shoot this issue.