So the correct way to config the next.config.js for the referrer-policy is:
Watch out the key
/** @type {import('next').NextConfig} */
const nextConfig = {
async headers() {
return [
{
source: "/:path*",
headers: [{ key: "Referrer-Policy", value: "no-referrer" }],
},
];
},
};
module.exports = nextConfig;
instead of :
{
key: 'Referrer',
value: 'no-referrer'
}
by doing this, it should fix the problem with occasionally failed to load the image from google