I am simply trying to load a background image into my Angular 4 project. The path I created for the image is 'src/assets/images/background.jpeg' I used the angular cli to generate my project so far but created the images directory simply by making a directory in atom.
This is the full error
ERROR in ./src/assets/images/background.jpeg Module parse failed: /Users/Joel/web_dev/projects/travel-journal/src/assets/images/background.jpeg Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type. (Source code omitted for this binary file)
@ ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader?{"ident":"postcss"}!./src/styles.css 6:179-221 @ ./src/styles.css @ multi ./node_modules/leaflet/dist/leaflet.css ./node_modules/bootstrap/dist/css/bootstrap.min.css ./src/styles.css
webpack: Failed to compile.
I am thinking that I need to say somewhere in a file that .jpeg is an appropriate file type, or need to install an image loader as suggested in the error.
I am still relatively new to Angular so was surprised not to find anyone with a similar issue that worked for me. I saw one that said make sure that your html comments are formatted correctly, which they are.
src/styles.css
body{
font-family: 'Jaldi', sans-serif;
background-image: url('assets/images/background.jpeg');
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
}
I haven't been able to find the webpack file or else I would post it. I researched that here. If there are any other files that would be helpful for this issue in this Angular project let me know.