Unable to import images from src folder
See original GitHub issueCurrently trying to import
images, but without extra configuration am unable to get it to build.
...
=> [✓] App Bundled: 3521.463ms
=> Exporting Routes...
{ SyntaxError: /Users/malonehedges/projectPath/src/assets/myimage.png: Unexpected character '�' (1:0)
> 1 | �PNG
| ^
...
“Add example configuring webpack to import images from the src folder”?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6 (6 by maintainers)
Top Results From Across the Web
cannot import image with create-react-app - Stack Overflow
I have a Home component and this is how I am importing the file: import photo from './party.png';. The component is located in...
Read more >Can't import image from src #585 - GitHub
So I have a list of reviews each with an logo field which is a path to the image. The images are in...
Read more >Easy Way to Use Images in React | No Import | No Require
What is the most simple and easy way to use images in ReactJS? This react js tutorial will answer following questions:- How to...
Read more >Importing Images With React - Stack Abuse
In this short article, learn how to import images in React using require() and the import statement.
Read more >React - load new image - error | Physics Forums
In the src folder there is a folder images with the old image. ... Module not found: Error: You attempted to import /logo.png...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This functionality is going to be built in, similar to Gatsby. It would seemingly only be a few lines of webpack config, but we’re currently reworking the innards of the build system a little bit to better accommodate things like this. Not only for built-in stuff, but for even further customization. Hang tight.
On Wed, Oct 18, 2017 at 9:50 AM Dan notifications@github.com wrote:
This should be fixed in the latest version. Please upgrade both global and local packages to version 2.0.0
Make sure you import and use the
withFileLoader
from react-static’s plugins in yourstatic.config.js
file:Then you can simply import images in your js