0

Need your help.

I am trying to display an image in our application and I am using require(path) as below.

const logo = require('../../public/images/logo.png');

in my img src..I am using as

<img src="::logo"/> is a different syntax we are using in our application in our internal framework.

this is working fine in my local and image is loading properly. But when I deploy it in the server, the path is not resolving properly. As I deploy it in our application, all the images goes to 'images' folder under 'dist'. Our applicatioURL goes similar to like this -

https://abc/def/index.html

But the image is pointing something like this -> https://abc/deflogo.ping

After def, the backslash is missing. Ideally it should be https://abc/def/logo.ping

I am assuming that some configuration is missing in our application. Can anyone throw some light here.

2
  • Try using just './public/images/logo.png'.
    – angel_dust
    Commented Feb 4, 2022 at 13:14
  • logo.png is under public/images folder. public is folder is not the same level, hence I used ../ to navigate to parent directory.
    – Sravan
    Commented Feb 4, 2022 at 13:26

0

Browse other questions tagged or ask your own question.