Lance F
Lance F

Reputation: 11

I keep getting this error: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file

Here's the full error:

ERROR in ./src/Component/logos.html 1:0
Module parse failed: Unexpected token (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
> <!DOCTYPE html>
| <html>
| <head>

Here's my logos.html file:

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>
    <script src="https://code.jquery.com/jquery-2.2.0.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">    
    <div class="container">
        <section class="customer-logos slider">
           <div class="slide"><img src='./logo1.png'></div>
           <div class="slide"><img src='./logo2.png'></div>
           <div class="slide"><img src='./logo3.png'></div>
           <div class="slide"><img src='./logo4.png'></div>
           <div class="slide"><img src='./logo5.png'></div>
           <div class="slide"><img src='./logo6.png'></div>
        </section>
     </div>
</body>
</html>

Here's my webpack.config.js:

var path = require('path');
var webpack = require('webpack');

module.exports = {
  entry: './index',
  output: {
    path: path.join(__dirname, 'dist'),
    filename: 'bundle.js',
    publicPath: '/dist/'
  },
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        loader: 'babel-loader',
        exclude: /node_modules/
      }
    ]
  }
}

I tried adding the webpack.config.js code, but the same error still occurs.

Upvotes: 1

Views: 1171

Answers (1)

Harshit Patel
Harshit Patel

Reputation: 21

In my case the problem was with the package bcrypt. I replace it with the bcrypt.js and it is working fine now.

import bcrypt from "bcrypt"; -> Causing this erro import bcrypt from "bcryptjs"; --> Use this instead.

Syntax and everything remains the same

Upvotes: 0

Related Questions