Tying to add static images in kibana plugin

Hi all,

Hope you are doing good.

I am trying to add images on my custom kibana plugin but i m getting below error. Any idea how to resolve below error in order to display static images in kibana plugin development.

Image markup:
<img src={require('../images/logo.jpg')} alt=""/>

Error Message :
Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.

Your advise is highly appreciated.

Thank you,

Kindest Regards,
Faizan

@Faizan, the easiest solution is going to be to use a .png instead of a .jpg as Kibana's optimizer is only using the url-loader for .pngs https://github.com/elastic/kibana/blob/master/src/optimize/base_optimizer.js#L240

1 Like

Thanks Brandon.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.