1

I am trying to understand how to correct this error. I have images defined in my SCSS, which, when compiled, I want to render.

When running vue-cli-service serve it results in the following error

 ERROR  Failed to compile with 1 errors                                                                                                                                                                                                                                     13:20:30
 error  in ./src/assets/imgs/photo.JPG

Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently, no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

I am using VueJS, and all the previous answers talk about installing a file handler and modifying the webpack config.

I have created vue.config.js (which, I think is not quite the webpack config but is???),

I have added this to vue.config.js (as per IMAGE: You may need an appropriate loader to handle this file type)

module: {
    loaders: [{
      test: /.jsx?$/,
      loader: 'babel-loader',
      exclude: /node_modules/
    }, {
      test: /\.css$/,
      loader: "style-loader!css-loader"
    }, {
      test: /\.(jpe?g|png|gif|woff|woff2|eot|ttf|svg)(\?[a-z0-9=.]+)?$/,
      loader: 'url-loader?limit=100000' }]
  }

but it results in the same errors.

Any ideas what I am doing wrong?

package.json contains

 "url-loader": "^4.1.0",
 "style-loader": "^1.2.1",
 "css-loader": "^3.5.3",
user5067291
  • 440
  • 1
  • 6
  • 16

0 Answers0