Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-scripts v4.0.0 causes local images to not load

See original GitHub issue

Describe the bug

Upgrading from v3.4.4 to v4.0.0 (using npm install react-scripts@latest) causes my local images (using src={require("../../assets/images/logo/logo-v4.png")}) to not load, however external images load. (see StackOverflow post here ) Fixed by simply downgrading to v3.4.4.


Tested using MacOS Catalina v10.15.7 and Windows 10 on Chrome Version 86.0.4240.111

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:31 (2 by maintainers)

github_iconTop GitHub Comments

qiqiboycommented, Nov 5, 2020

try const logov4 = require("../../assets/images/logo/logo-v4.png").default or import logov4 from "../../assets/images/logo/logo-v4.png"

Deivi2commented, Dec 14, 2020

Issue still there

Read more comments on GitHub >

github_iconTop Results From Across the Web

React.js project local images suddenly stopped loading
0.0, so I downgraded to v3.4.4, and the local images loaded properly. I will open an issue on the react-scripts GitHub page!
Read more >
"The NPM script 'start' exited without indicating that the create ...
When I try to run my project I always get this error: 181477-image.png. I've tried everything I've seen online, and it still fails....
Read more >
Fixing create-react-app when npm fails to start because your ...
This causes npm start to fail in my Create React App folder. Attempting to bind to HOST environment variable: x86_64-apple-darwin13.4.0. Error: getaddrinfo ...
Read more >
The React Scripts Start Command – Create-React-App NPM ...
These build tools are required because React's JSX syntax is a language that the browser doesn't understand. To run your React application, ...
Read more >
create react app env variables not loading -
You need to integrate variable with start script. "scripts": { "start" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found