This repository has been archived by the owner on Apr 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 519
Import image into React component fails on server-side render #413
Comments
Matt, try something like:
This way the loader might handle it properly. Don't remember if that will work, I'm not by a computer at the moment. The best alternative is using CSS, and putting the image in the regular background-image property there, the loader will handle that correctly as well. Hope that helps! |
Thanks @MarkPieszak. I tried using Will have to go down the CSS route as you suggest! |
Ah it works when I move the loaders from the |
There it is 🙈😃 |
This was referenced Sep 16, 2021
This was referenced May 14, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm using the ReactRedux template but I'm using ES6 not TypeScript.
I'm trying to import an image into a React component but when I run
webpack
I get a module parse failure:My component looks like this:
Here is my
webpack.config.js
:Any pointers you could give would be much appreciated.
The text was updated successfully, but these errors were encountered: