-
|
I am trying to create a PWA and I got the pages to work on a run build without any errors... however... I am getting this warning from the local host 3000
Would anybody know how to fix that? Also.... I don't think I got the PWA working properly, because I can't see a "download" button of the page in the browser... Why do you think I would be getting that error? ... and what else would I need to convert it into a PWA? The site I am working with is this one: |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 2 replies
-
|
So... I don't see this in my vscode public file: Shouldn't those be generated automatically when I do npm run build? I can see everything was build OK supposedly? |
Beta Was this translation helpful? Give feedback.
-
|
BTW... I am using this video as reference ^^ on this video the sw.js is generated during the build.... I also didn't create a server... Along with this link here... which I will add more meta data later... |
Beta Was this translation helpful? Give feedback.
-
|
This is more of an issue with |
Beta Was this translation helpful? Give feedback.
-
|
I think it might have to do with the manifest as well.... |
Beta Was this translation helpful? Give feedback.
-
use this rather in next.config.js const withPWA = require("next-pwa")({ module.exports = withPWA({ |
Beta Was this translation helpful? Give feedback.
-
|
I would suggest not using next-pwa any more. My solution was to put the manifest.json along with all the icon sizes you want, and the sw.js in the public foldder... then created an app.js for service workers in the public folder...... then inside my _app.js in the pages folder called the manifest and the service workers like this: then on the bottom of the _app.js page called the service workers like this: and it worked... Gotta do a few more little additions/fixes for the PWA but it is working... You can dig the code out in here: |
Beta Was this translation helpful? Give feedback.
-
you need to disable pwa during development , doing that fix the error GenerateSw |
Beta Was this translation helpful? Give feedback.
I would suggest not using next-pwa any more.
My solution was to put the manifest.json along with all the icon sizes you want, and the sw.js in the public foldder...
then created an app.js for service workers in the public folder......
then inside my _app.js in the pages folder called the manifest and the service workers like this:
then on the bottom of the _app.js page called the service workers like this:
<script async type="module" src="app.js"></script>and it worked...
Gotta do a few more little additions/fixes for the PWA but it is working...
You can dig the code out in here:
https://gith…