Open marcofranssen opened 2 years ago
Hi @marcofranssen, there's another thread that suggest to downgrade to 5.5.4 #378 This #372 should solve the issue.
I fixed 5.5.5 release in #384. Already tested on my personal blog. Basically 1 line of code was missing and one had to be adjusted. All the rest in this PR is code cleanup.
having the same issue after upgrading to 5.5.5.
having the same issue after upgrading to 5.5.5.
Correct, my fix has to be released as a 5.5.6
.
having the same issue after upgrading to 5.5.5.
Correct, my fix has to be released as a
5.5.6
.
excellent! when would that be?
excellent! when would that be?
I hope as soon as possible. Depends on the maintainer of this repo.
I hope as soon as possible. Depends on the maintainer of this repo.
Thank you. I have tried your PR and it works well. While this PR is not yet merged and public release everyone can try this:
"dependencies": {
"next-pwa": "marcofranssen/next-pwa#fix-pwa-config",
}
Hope it will help you.
Hi guys, try to add require and export.
PWA: 5.6.0 Next.js: 12.2.3
ignore webpack config
same problem here.
next-pwa versions tried: 5.5.4
, 5.5.5
, 5.6.0
next version: 11.1.0
Don't know what to do anymore.
works now after rewriting the config a bit more the way @willianrr suggested. Thx for mentioning it, would have never seen it in the documentation. Cause no upgrade-docs, no warnings, no errors. Nothing.
my config (might be different for others)
const withPWA = require("next-pwa")({
dest: "public",
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === "development",
})
...
module.exports = withConfig(
withPlugins([[withPWA, withBundleAnalyzer]], withNextein, nextConfig)
);
Summary
When defining following config in my
next.config.js
the filessw.js
andworkbox-*.js
do not end up in the public folder as explained in the README.md that states if using Nextjs 9 or newer the files will be there. Instead I do see those files end up in the.next
folder.My config looks like:
Versions
next-pwa
: 5.5.5next
: 12.2.4How To Reproduce
Steps to reproduce the behavior:
Expected Behaviors
The files end up in
public
.Screenshots
N.A.
Additional Context
Also notice the BABEL Note in the log above. Maybe it makes sense to switch from Babel to
vercel/ncc
to bundle the service worker.The rootcause is this line https://github.com/shadowwalker/next-pwa/blob/master/index.js#L56