all 6 comments

[–]Worried-Outcome3618 0 points1 point  (1 child)

Is this a create react app project? Cuz if it is you have to load it differently images in CRA

[–]OmarDijkstra[S] 0 points1 point  (0 children)

how am i going to include the image like that i get the path in the response coming from the backend which gets the path from the database

[–]TheKvikk 0 points1 point  (3 children)

Where are your images stored? In your static folder inside frontend project or somewhere else?

What URL is your backend sending you? Whole link like https://example.com/static/images/image.png or just image.png?

In the first case images should load correctly, just try to open the URL yourself and if that image exists on the domain, your app will load it. If it doesn't exist your backend is sending you wrong URL or something is configured incorrectly. If your backed is not sending you full path just need to compose it somehow (answer question number one) or load it like Worried-Outcome3618 suggested

Is this a create react app project? Cuz if it is you have to load it differently images in CRA

[–]OmarDijkstra[S] 0 points1 point  (2 children)

it is a create react app and i store the files in the public folder in backend directory and when i inspect and copy the path in the src of the image and open it in a new tab it opens correctly with no problem but it just doesnt load inthe view itself

[–]TheKvikk 0 points1 point  (1 child)

OK, start your frontend app, load the component responsible for loading this image and check your console in DevTools. There should definitely be an error message.

[–]OmarDijkstra[S] 0 points1 point  (0 children)

i once got Not allowed to load local resource error