Bug: Image not loading in the production build 路 Issue #8552 路 facebook/create 您所在的位置:网站首页 yy-folder/img/shoujibizhi01.jpg Bug: Image not loading in the production build 路 Issue #8552 路 facebook/create

Bug: Image not loading in the production build 路 Issue #8552 路 facebook/create

2024-06-13 23:01| 来源: 网络整理| 查看: 265

I am using the images by doing the import IMG from '../path/a.png' way. After thenpm run build the static/media contains only some images with hashed name others could be embedded in the logo.5d5d9eef.svg . In the production server where this is deployed. I don't see the images rendered which are hashed with data:image/png;base64,iV......w0K format . Where as other images are coming . If I click and open the uri in the browser It does opens the image but in my app it is not rendering.

Any inputs regarding this would be helpful

React version:16.12

Steps To Reproduce

1.Create-React-App project 2.Create some image renders with import IMG from '../path/a.png format 3.npm run build 4.Deploy in the server 5.It has generated a data:image/png;base64 6.This is rendered as complex instead of the image, which works fine if the url is opened in another tab. 7. image 8.Why some images are converted to base64 image and others as regular static content. 9.Is there any workaround to avoid and make all the images as static resources.

Any help in this regard is hugely appreciated.

Thanks

Link to code example:

The current behavior

image

The expected behavior

image



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有