Next.js Discord

Discord Forum

Image preview not showing

Answered
Scottish Fold posted this in #help-forum
Open in Discord
Scottish FoldOP
So, I am working for a club website, trying to make the image preview but it is not loading the preview. How to fix it?
Answered by alfonsüs ardani
try changing it to
const siteUrl = process.env.NODE_ENV === "development"
  ? `http://localhost:3000/`
  : 'https://bookworms-of-hstu.vercel.app/';
View full answer

24 Replies

Scottish FoldOP
This is my code
@alfonsüs ardani how do you know that image preview is not loading the preview?
Scottish FoldOP
So, I put the link both in facebook and discord just to check this. Turns out that the preview image doesn't show up
can we see the link to troubleshoot?
Scottish FoldOP
see? nothing
this is weird because it shouldve used the correct link
const siteUrl = process.env.VERCEL_URL
  ? `https://${process.env.VERCEL_URL}`
  : 'http://localhost:3000';
im not sure why its using the branch deployment link instead of the production link
@Scottish Fold How to solve this then?
try changing it to
const siteUrl = process.env.NODE_ENV === "development"
  ? `http://localhost:3000/`
  : 'https://bookworms-of-hstu.vercel.app/';
Answer
Scottish FoldOP
made a change but still it is not doing as expected
thats so weird...
it works @Scottish Fold , its just those platform caches previous result
Scottish FoldOP
just need to wait few hours for the cache to refresh
Oh
thanks man
add different queries everytime you change the og
like ?123 or ?abc
if u wanna see quickly