strapi-starter-next-blog icon indicating copy to clipboard operation
strapi-starter-next-blog copied to clipboard

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

Open Aravin opened this issue 4 years ago • 5 comments

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

Aravin avatar Aug 15 '21 08:08 Aravin

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

jonathancary avatar Sep 06 '21 19:09 jonathancary

I used CDN.

Aravin avatar Sep 07 '21 04:09 Aravin

Cloudinary to host images.

Aravin avatar Sep 07 '21 04:09 Aravin

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

Const a siteUrl + your imageUrl.

sengho66 avatar Oct 13 '21 16:10 sengho66

Nope, I used siteUrl from .env and appended

On Wed, 13 Oct 2021 at 21:33, thenotoriousjr @.***> wrote:

@Aravin https://github.com/Aravin Did you ever find a solution to this? Having the same problem.

Const a siteUrl + your imageUrl.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/strapi/strapi-starter-next-blog/issues/47#issuecomment-942453556, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFEZEPLH2W2FRNANJK5LD3UGWUUNANCNFSM5CF6OGIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Thanks & Regards, Aravind A http://aravin.net

Aravin avatar Oct 15 '21 12:10 Aravin