Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Images added inside the Strapi articles are not loading in Next.js Client #47

Open
Aravin opened this issue Aug 15, 2021 · 5 comments
Open

Comments

@Aravin
Copy link

Aravin commented Aug 15, 2021

Hi Team,

I have Strapi running on localhost:1337
and next.js client running on localhost:3000

One of my articles has content with images. This is a sample image URL

/uploads/ccavene_integration_using_nodejs_express_3_1_011e2d9844.png

Then this article is rendered in Next.js, the broken image is displayed since the full path was

http://localhost:3000/uploads/ccavene_integration_using_nodejs_express_1_2091255f08.png ❌ (which is wrong)
http://localhost:1337/uploads/ccavene_integration_using_nodejs_express_1_2091255f08.png ✔️ (which is rite)

I can parse the articles and relate the /uploads/ with HOST:PORT/uploads/

I wanted to know if there is any solution by Next.js or Strapi

@jonathancary
Copy link

@Aravin Did you ever find a solution to this? Having the same problem.

@Aravin
Copy link
Author

Aravin commented Sep 7, 2021

I used CDN.

@Aravin
Copy link
Author

Aravin commented Sep 7, 2021

Cloudinary to host images.

@sengho66
Copy link

@Aravin Did you ever find a solution to this? Having the same problem.

Const a siteUrl + your imageUrl.

@Aravin
Copy link
Author

Aravin commented Oct 15, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants