SVG Files are not included in the dev bundle.
See original GitHub issueCan you reproduce the problem with latest npm?
Yes
Description
SVG files fail to be included in the development bundle.
This occurs when the image is imported like so:
import Logo from '../../common/img/logo.svg';
and used like so:
<img src={Logo} />
Other image files (.png, .jpg, etc) render as expected, but SVG files never come through.
Expected behavior
SVG images should load as normal.
Actual behavior
Renders as a broken <img />
tag. When the URL to the image, as output by Webpack, is entered into the URL bar, it renders this error: “error on line 1 at column 1: Document is empty”.
Environment
Node version 7.9.0 NPM version 4.2.0 Windows 10 | Version 1703 | OS Build 15063.0 Google Chrome | 58.0.3029.81 (64-bit)
Reproducible Demo
Due to some time constraints, I can’t make a demo at the moment. If you can’t reproduce this issue let me know and I’ll try to get a demo up.
Issue Analytics
- State:
- Created 6 years ago
- Comments:26 (13 by maintainers)
Top GitHub Comments
I believe it’s worth noting that you do not need to eject to use Sass, you can read how to do that in our docs.
@gaearon Sorry, forgot to paste it. Demo