favicon not changing
Unanswered
Southeastern blueberry bee posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
as u can see my favicon isnt changing
74 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183104436445388881/image.png?ex=65871ede&is=6574a9de&hm=92f29dd21388c49afb8eaf83dad6e99098a6508034a41ca01798cca4b3702bbd&)
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183104436806111352/image.png?ex=65871ede&is=6574a9de&hm=f2ece650c961d14acc99961b9152cb6df1f5dee48fc8d34ae38c7472a3277792&)
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183104457735688202/image.png?ex=65871ee3&is=6574a9e3&hm=d6adac76c9dbb5dde37229608d4ff0891a0870ddd7b201b1f450bdcf9ebe9d3d&)
![Avatar](https://cdn.discordapp.com/avatars/301376057326567425/788b75eb8862277af3d31d317ada783f.webp?size=256)
B33fb0n3
Would you be able to show the full project structure? @Southeastern blueberry bee
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183105362841309214/image.png?ex=65871fbb&is=6574aabb&hm=ec2e057496ada1a1cdd294b969696373f9b8436b3a33dd02b3656f68368a64fc&)
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183105409943351296/image.png?ex=65871fc6&is=6574aac6&hm=3bd72609fdf6298250198b3684388d7914245a5c3a02d0266938dfa221aeb566&)
this in /client
![Avatar](https://cdn.discordapp.com/avatars/301376057326567425/788b75eb8862277af3d31d317ada783f.webp?size=256)
B33fb0n3
The favicon.ico is inside /app?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
yes
thats where it is put when i do
npx create-next-app@latest ...
so i put my custom one there
![Avatar](https://cdn.discordapp.com/avatars/301376057326567425/788b75eb8862277af3d31d317ada783f.webp?size=256)
B33fb0n3
Would you rename it to „icon.ico“ and restart your app and clear the cache?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
cache of my bnrower?
![Avatar](https://cdn.discordapp.com/avatars/301376057326567425/788b75eb8862277af3d31d317ada783f.webp?size=256)
B33fb0n3
Yes
You don’t have a middleware, right?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
express
const express = require("express");
const next = require("next");
const cors = require('cors')
const port = 8080;
const dev = "production";
const app = next({ dev, dir: '../client' });
const handle = app.getRequestHandler();
app.prepare().then(() => {
const server = express();
server.use(cors())
server.get('/', (req, res) => {
return app.render(req, res, "/");
});
server.get('/api/v1/guildamount', async (req, res) => {
return res.send({ amount: '1' })
})
server.listen(port, (err) => {
if (err) throw err;
console.log(`Ready on http://localhost:${port}`);
});
});
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
English Angora
I have my favicon in /public and I have it linked in my <head> like this:
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="/favicon.ico" />
![Avatar](https://cdn.discordapp.com/avatars/301376057326567425/788b75eb8862277af3d31d317ada783f.webp?size=256)
B33fb0n3
He uses the app folder. He can’t use the <Head> part
Your images are also run thought this?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
no
thats all of my index.js
in /server
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
English Angora
Whaaat? So if you use app, you can't use Next Head?
![Avatar](https://cdn.discordapp.com/avatars/301376057326567425/788b75eb8862277af3d31d317ada783f.webp?size=256)
B33fb0n3
That’s Pages dir only
Do you see where the browser calls the favocon from?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183107032384028722/image.png?ex=65872149&is=6574ac49&hm=5bf24d1ad0c9a6c8ac81e46cb9a1b137c8321b4dcfa39f76cff163a1e139f333&)
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183107056878764162/image.png?ex=6587214f&is=6574ac4f&hm=ce018c8ee1c587c11b3ee2337735a5efc925e0fdffac5cbdffb49589450d9a9c&)
![Avatar](https://cdn.discordapp.com/avatars/301376057326567425/788b75eb8862277af3d31d317ada783f.webp?size=256)
B33fb0n3
Does your head tag in your browser contains the url to the favocon?
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
https://github.com/vercel/next.js/discussions/14532#discussioncomment-30197
you need this on your express
you need this on your express
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183107306389524561/image.png?ex=6587218a&is=6574ac8a&hm=4a61497c6eb4fa9535b8ecff2e0f1d3d3fe9e49a8293a010541e818b08ae0bce&)
![Avatar](https://cdn.discordapp.com/avatars/301376057326567425/788b75eb8862277af3d31d317ada783f.webp?size=256)
B33fb0n3
Yea, then it’s served though next. Then you need to do it like ray said
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
and put the ico to public
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
doesnt work
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183108084193829095/image.png?ex=65872244&is=6574ad44&hm=bfeaa58e43b4020eb202c5dcac0aa27a1a0e49642258d313fc5888167590bc13&)
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183108108130721893/image.png?ex=6587224a&is=6574ad4a&hm=f5ef8f47b0c3bb340b7e34182b7e54fb35c2ca6819446658f5df00badff69368&)
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
click this link and see if it can open the ico?
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183108529352085554/image.png?ex=658722ae&is=6574adae&hm=32a6d32e66eac6e83e9d8775f05eea9f0bf3403625a09a292774d26aafbefb9e&)
its not even there
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
ok put this on your app/layout.tsx
export const metadata = {
icon: "/favicon.ico"
}
icon: "/favicon.ico"
}
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183108840384909342/image.png?ex=658722f8&is=6574adf8&hm=f7a276953d739cc1455fc4945388e85561aa9f19bd30fbb405e785d870004de4&)
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
sorry should be
export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
icons: {
icon: '/favicon.ico'
}
}
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
didnt change anything
and when i do /favicon.ico
CANNOT GET /favicon.ico
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
its on custom url
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
also need to remove app/favicon.ico
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
show the server code again pls
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
const express = require('express');
const next = require('next');
const path = require('path');
const cors = require('cors')
const port = 8080;
const dev = "production";
const app = next({ dev, dir: '../client' });
const handle = app.getRequestHandler();
app.prepare().then(() => {
const server = express();
server.use(express.static(path.join(__dirname, '../client/public')))
server.use('/_next', express.static(path.join(__dirname, '../client/.next')))
server.use(cors())
server.get('/', (req, res) => {
return app.render(req, res, "/");
});
server.get('/api/v1/guildamount', async (req, res) => {
return res.send({ amount: '1' })
})
server.listen(port, (err) => {
if (err) throw err;
console.log(`Ready on http://localhost:${port}`);
});
});
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183110315223826473/image.png?ex=65872458&is=6574af58&hm=a18819bc80d3432e9b330c63f1bcef94b31aab3af4702d84d409605b18a222b4&)
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
ill turn it on
try now
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
English Angora
Now that I think of it, I had an issue at work where the public folder didn't show files. It was on React, but I suspected it could have been due to webpack not being configured properly. I have no idea if this info would help
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
it shows
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183110776848924672/image.png?ex=658724c6&is=6574afc6&hm=1dd4b70af081f0730a42f8bbbc230cf70779067b505b4b603f00b659196e849e&)
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
what
it doesnt for me
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183110991823786055/image.png?ex=658724f9&is=6574aff9&hm=33bdafa7ab02bf7e42c1dffb8ce7cb99b25abfc29a8bfc4187db90ce6ea3c6d0&)
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183111083117002772/image.png?ex=6587250f&is=6574b00f&hm=503c8ffd646c9a4356f933ccf94d65b893a9faf72926dfe5386e077bc68ecd31&)
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
clear your browser cache?
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183111274909929512/image.png?ex=6587253d&is=6574b03d&hm=500223f31f08d9532327ef799caf8fe527274ba18698bae0521f185fe0d489d4&)
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183111358150103110/image.png?ex=65872550&is=6574b050&hm=863d03d36d8e4995aafe76ac1660a0e3d8a6e53956abbf999972cfe0f6903c7e&)
i pressed clear data
and it doesnt fix
![Avatar](https://cdn.discordapp.com/avatars/743561772069421169/3c5d689eee4459a24fc420063411c016.webp?size=256)
Ray
or purge cf cache too
its cached
![Image](https://cdn.discordapp.com/attachments/1183104408792354926/1183111502220234822/image.png?ex=65872573&is=6574b073&hm=8a5cf07d9bd2f54c08215427b2a7113025a019460b7e2e89a1274419de45403b&)
or wait for 14400
as long as it show on my side, it should work
or ask someone who can try to open it
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Southeastern blueberry beeOP
ok
ty