-
-
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
Images not showing in production build #12005
Comments
My problem was solved just by adding |
我也遇到遇到同样的问题,还有种办法是修改css extract插件的publicPath属性,但是我不知道这个属性在哪配置? |
I've faced same issue, the error was before: // file:///file-name.png
<img src={`/${item.imageUrl}`} /> to: // file://file-name.png
<img src={item.imageUrl} /> Hope this would help as well. 🚀 |
修改webpack的publicPath为auto就可以 |
I had the same problem but solved it by importing images instead of using exact path on src
this way
|
Problem
Recently, I've created a web app with react as my college assignment. The web app worked fine during the development. But in the production build I was able to see only a blank screen. I opened the console and found this
I searched about this problem on Stack Overflow but I could not find a proper solution.
I've opened the build folder to look if I can figure out the problem. then I realized the file paths have a / (slash) in front of it
so I've change the code to
now all the css and javascript files load properly. but the images are not loading so I've add the following code in a script tag
now all the images that will be displayed in the initial screen gets loaded properly, but the problem persists with the remaining images
I've tried adding
MutationObserver
but that didn't work eitherSo, could you please tell me a quick way to solve this issue ?
Thank you for kindly reading my report
The text was updated successfully, but these errors were encountered: