how to convert my next js app into a Progressive Web App
Answered
Siberian posted this in #help-forum

SiberianOP
I don't see this icon in address bar

Answered by risky
i say in just have metadata.json in /app and then not in metadata+public is easier
62 Replies

do you have a
manifest.json
or manifest.webmanifest
file in the root of app dir (or in public folder and then linking with metadata)?
@risky do you have a `manifest.json` or `manifest.webmanifest` file in the root of app dir (or in public folder and then linking with metadata)?

SiberianOP
export const metadata = {
title: "Create Next App",
description: "Generated by create next app",
manifest:'/public/manifest.json'
};
I have
do you wanna see my manifest file ?

firstly, you can put the manifest in root of /app and not worry about adding to menifest
secondly, anything in /public is accessible in / (ie it would be just .manifest.json)

@risky firstly, you can put the manifest in root of /app and not worry about adding to menifest

SiberianOP
I still don't see the icon

hmm i got it when i made a really basic one
what does yours have

SiberianOP
what do you mean ?

whats the content
like mine is very simple and worked for me: https://emailthing.xyz/manifest.webmanifest and i can see it at https://emailthing.xyz

@risky whats the content

SiberianOP
its just normal next js boilerplate code

@Siberian do you wanna see my manifest file ?

yeah can i see it, and have you made the just
manifest:'/manifest.json'

@risky yeah can i see it, and have you made the just `manifest:'/manifest.json'`

SiberianOP
wait where should I put this property ?

export const metadata = {
title: "Create Next App",
description: "Generated by create next app",
manifest:'/manifest.json'
};

SiberianOP
nope still doesnt work

can you share the content of the manifest.json tho (it may need start_url or smth)

SiberianOP
{
"name": "My awesome PWA app",
"short_name": "PWA App",
"icons": [
{
"src": "192.jpg",
"sizes": "192x192",
"type": "image/jpg",
"purpose": "any maskable"
},
{
"src": "384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "512.jpg",
"sizes": "512x512",
"type": "image/jpg"
}
],
"theme_color": "#FFFFFF",
"background_color": "#FFFFFF",
"start_url": "/",
"display": "standalone",
"orientation": "portrait"
}
this is mine
oh that is basicly all i have ðŸ˜
and your using google chrome im guessing

SiberianOP
firefox

oh thats the issue

SiberianOP
HUH

firefox doesnt have pwa in that sense anymore
are you saying you see it in other sites?
as i have have not seen it recently on any sites

SiberianOP
I dont see it in twitter too

yeah if you try chrome or edge, it should work
(sorry, i kinda assumed based on the screenshot and most use chrome these days, i use firefox but very minority)

SiberianOP
still not there 😦


😦
WHYYyyYy does it not work

SiberianOP
do you wanna guide me from the start if its too much to ask ?

based on what you have said, you have done everything i did..

SiberianOP
/** @type {import('next').NextConfig} */
import withPWAInit from "@ducanh2912/next-pwa";
const nextConfig = {};
const withPWA = withPWAInit({
dest: "public",
cacheOnFrontEndNav:true,
aggressiveFrontEndNavCaching:true,
reloadOnOnline:true,
disable: false,
register: true,
scope: "/app",
sw: "service-worker.js",
workboxOptions:{disableDevLogs:true}
});
export default withPWA({
});
here is my config file btw
hmm i have no idea if that would mess with things
if you open dev tools
and can you find the tag like this in >head>


SiberianOP
hol up


what does
localhost:3000/manifest.json
show 👀it better be the same file

SiberianOP
o.O


ohhh thats going to be because of your lib

SiberianOP
wait I have 2 manifest files

they must be making the manifest file themself

SiberianOP
which one do I delete ?

i think you should remove yours

SiberianOP
no look one is in public folder and another is in app folder like you suggested


oh only have it on one place
not both public and app

i say in just have metadata.json in /app and then not in metadata+public is easier
Answer

SiberianOP
which do I delte ?

the one in public

SiberianOP
OMG
FINALLY
THANK YOU

YAYYYYyYy

@Siberian THANK YOU

no problem, if you have some more pwa issues feel free to make another thread (i personally have only used it to make the new window and nothing else ;()