question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version 3.0.0 breaks webpack build

See original GitHub issue

I just upgraded from 1.0.2 to 3.0.0 and now my webpack-dev-server build just hangs forever.

I downgraded to 2.1.0 and the problem has gone away.

Unfortunately I don’t have any logs to share.

My webpack config, for reference:

/* eslint-disable @typescript-eslint/no-var-requires */

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
const ErrorOverlayPlugin = require('error-overlay-webpack-plugin');
const WatchExternalFilesPlugin = require('webpack-watch-files-plugin').default;

module.exports = {
  entry: {
    main: './main.tsx',
  },
  output: {
    path: path.resolve(__dirname, 'bundle'),
    filename: '[name].js',
  },
  resolve: {
    extensions: ['.ts', '.tsx', '.js'],
  },
  devtool: 'source-map',
  mode: 'development',
  devServer: {
    port: 9001,
    host: '0.0.0.0',
    disableHostCheck: true,
    stats: 'minimal',
    overlay: {
      warnings: true,
      errors: true,
    },
    before(_, server) {
      setImmediate(() => {
        const qrcode = require('qrcode-terminal');
        const chalk = require('chalk');

        const hostname = require('os').hostname();

        const port = server.listeningApp.address().port;

        const localURL = `http://localhost:${port}`;
        const remoteURL = `http://${hostname}:${port}`;

        console.log();
        console.log(chalk.yellow('Ctrl + click here:'), chalk.underline.blue(localURL));
        console.log();
        console.log(chalk.yellow('On your phone:'), chalk.underline.blue(remoteURL));
        console.log();
        qrcode.generate(remoteURL);
        console.log();
      });
    },
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: 'Controller',
      meta: { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' },
    }),
    new FaviconsWebpackPlugin('./assets/robot.png'),
    new ErrorOverlayPlugin(),
    new WatchExternalFilesPlugin({
      files: ['../shared/**/*.ts'],
    }),
    // new webpack.HotModuleReplacementPlugin(),
  ],
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        loader: 'ts-loader',
        exclude: /node_modules/,
      },
      {
        test: /\.less$/,
        use: [{ loader: 'style-loader' }, { loader: 'css-loader' }, { loader: 'less-loader' }],
        exclude: /node_modules/,
      },
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader'],
        // exclude: /node_modules/,
      },
      {
        test: /\.(png|woff|woff2|eot|ttf|svg)$/,
        loader: 'url-loader?limit=100000',
        // Need file-loader?
      },
    ],
  },
};

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jantimoncommented, Jan 29, 2020

Released the fix as 3.0.1 so at least will not hang without an error.
Thanks a lot for reporting.

Version 4.0 is still beta but already heavily used e.g. by facebooks create-react-app https://www.npmjs.com/package/html-webpack-plugin/v/4.0.0-beta.11

0reactions
jantimoncommented, Jul 27, 2020

html-webpack-plugin version 4.0 has been released https://dev.to/jantimon/html-webpack-plugin-4-has-been-released-125d

The latest favicons-webpack-plugin provides a error message if the versions missmatch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack errors after update to 3.0.0-beta.16 #891 - GitHub
Hi there,. after upgrading to 3.0.0-beta.16, there are some errors in my webpack build that I cannot quite figure out on my own....
Read more >
Webpack (v 3.0.0) validateSchema error in dev mode
The new version of webpack-cli adds webpack to the global process object. This causes applications such as webpack-dev-derver to break since ...
Read more >
Installation | webpack
This guide goes through the various methods used to install webpack. Prerequisites. Before we begin, make sure you have a fresh version of...
Read more >
Webpack - npm
Webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Development - webpack 3 documentation
webpack built 27b137af6d9d8668c373 in 1198ms Hash: 27b137af6d9d8668c373 Version: webpack 3.0.0 Time: 1198ms Asset Size Chunks Chunk Names app.bundle.js 1.44 MB ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found