-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Build Images don't show #10438
Comments
Would you add more info about the issue |
AFAIK, there is a known issue with react-scripts. Try using an older version like 3.4.4 |
@Hrishi1999 Could you give us the link to the issue you mention? Also downgrading isn't really a good solution as CRAv3.4.4 contains some vulnerabilities for which we want to upgrade to v4. The issue seems to be rooted somewhere in the way CRA4 packages the images, or the way it references them. I suspect this is not an issue if the images are in the local repo (hence it has not been captured in the tests I'm guessing). The reason for this conjecture is that when I import an image from a library (another repo) and point to the file within the src folder it works fine. However if referencing the dist folder (ie the compiled location), it inserts the object into the src prop as seen in the figure. This wouldn't be that big of a problem if not for the fact that some of the components we use from the given library also contain images and these are broken too, but cannot be "fixed" the same way. |
@jurajpiar This issue: #9992 |
use ".default" after require inside img src, it will fix the issue. Earlier => src={require( |
So, I have several images on my react App, but, after run the "npm run build" to create an optimization build, the images doesn't appear. Why?
The text was updated successfully, but these errors were encountered: