Update to 2.1.0-beta.25 causes parseQuery should get a string as first argument

I’m submitting a bug report

Webpack version:
2.x

Please tell us about your environment:
Windows 10

Current behavior:
I recently upgraded to webpack 2 beta 25 from beta 20. In beta 20, my entire configuration worked and the compilation worked. Upgrading to webpack 25 causes this error:

image

I’m running the compiler script using babel-node.

import webpack from 'webpack';
import _debug from 'debug';

const debug = _debug('build:webpack-compiler');
const DEFAULT_STATS_FORMAT = {
  chunks: false,
  chunkModules: false,
  colors: true,
};

export default function webpackCompiler(webpackConfig, statsFormat = DEFAULT_STATS_FORMAT) {
  return new Promise((resolve, reject) => {
    const compiler = webpack(webpackConfig);

    /* eslint-disable consistent-return */
    compiler.run((err, stats) => {
      if (err) {
        debug('Webpack compiler encountered a fatal error.', err);
        return reject(err);
      }

      const jsonStats = stats.toJson();
      debug('Webpack compile completed.');
      debug(stats.toString(statsFormat));

      if (jsonStats.errors.length > 0) {
        debug('Webpack compiler encountered errors.');
        debug(jsonStats.errors.join('\n'));
        return reject(new Error('Webpack compiler encountered errors'));
      } else if (jsonStats.warnings.length > 0) {
        debug('Webpack compiler encountered warnings.');
        debug(jsonStats.warnings.join('\n'));
      } else {
        debug('No errors or warnings encountered.');
      }
      resolve(jsonStats);
    });
  });
}
  • Language: [all | TypeScript X.X | ES6/7 | ES5 | Dart | …]
    ES6/7

Author: Fantashit

2 thoughts on “Update to 2.1.0-beta.25 causes parseQuery should get a string as first argument

  1. There is old loader-utils in webpack’s package.json “loader-utils”: “^0.2.11”
    But only latest 0.2.16 is now compatible with webpack 2. For some reason it didn’t updated.
    Short fix:
    npm i loader-utils

Comments are closed.