Webpack4 uses css-loader to prompt error?

the webpack I configured reported an error when using css-loader. Preprocessing like less is a mistake like this.
webpack is configured as follows.

const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");

function resolve(dir) {
  return path.join(__dirname, "../", dir);
}

module.exports = {
  entry: "./src/index.js",
  output: {
    filename: "bundle.js",
    path: path.resolve(__dirname, "../dist")
  },
  resolve: {
    extensions: [".json", ".jsx", ".js"],
    alias: {
      "@": resolve("src")
    }
  },
  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        loader: "babel-loader"
      },
      {
        test: /\.css$/,
        use: [ "style-loader", "css-loader" ]
      },
      {
        test: /\.(woff|woff2|eot|ttf|otf)$/,
        loader: "url-loader"
      },
      {
        test: /\.(jpg|jpeg|png|gif)$/,
        loader: "url-loader",
        query: {
          limit: 10000
        }
      },
      {
        test: /\.html$/,
        loader: "html-loader"
      },
      {
        exclude: [/\.js$/, /\.html$/, /\.styl$/, /\.json$/],
        loader: "file-loader",
        options: {
          name: "static/[name].[hash:8].[ext]"
        }
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: "index.html",
      template: "src/index.html",
      inejct: true
    })
  ]
};
Dec.08,2021

remove file-loader that rule, generally url-loader is enough


there is no complete code, so we can only guess that css-loader load has an incorrect file.

consider changing the rule of module to oneof, as follows:

module: {
    rules: [
      {
        oneOf: [
          {
            test: /\.(js|jsx)$/,
            exclude: /node_modules/,
            loader: 'babel-loader'
          },
          {
            test: /\.css$/,
            use: ['style-loader', 'css-loader']
          },
          {
            test: /\.(woff|woff2|eot|ttf|otf)$/,
            loader: 'url-loader'
          },
          {
            test: /\.(jpg|jpeg|png|gif)$/,
            loader: 'url-loader',
            query: {
              limit: 10000
            }
          },
          {
            test: /\.html$/,
            loader: 'html-loader'
          },
          {
            exclude: [/\.js$/, /\.html$/, /\.styl$/, /\.json$/],
            loader: 'file-loader',
            options: {
              name: 'static/[name].[hash:8].[ext]'
            }
          }
        ]
      }
    ]
  },
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c436-4d99a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c436-4d99a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?