Fork-ts-checker-webpack-plugin: UnhandledPromiseRejectionWarning: RangeError: Invalid count value (in docker-compose on Mac)

Created on 15 Sep 2020  路  2Comments  路  Source: TypeStrong/fork-ts-checker-webpack-plugin

Current behavior

Currently when using webpack-dev-server every build is logging the following when running inside a docker-compose container (the behavior is not seen outside the docker container):

Issues checking in progress...
(node:328) UnhandledPromiseRejectionWarning: RangeError: Invalid count value
    at String.repeat (<anonymous>)
    at highlightedLines.split.slice.map (/app/node_modules/fork-ts-checker-webpack-plugin/node_modules/@babel/code-frame/lib/index.js:121:135)
    at Array.map (<anonymous>)
    at Object.codeFrameColumns (/app/node_modules/fork-ts-checker-webpack-plugin/node_modules/@babel/code-frame/lib/index.js:108:65)
    at codeFrameFormatter (/app/node_modules/fork-ts-checker-webpack-plugin/lib/formatter/CodeFrameFormatter.js:16:34)
    at webpackFormatter (/app/node_modules/fork-ts-checker-webpack-plugin/lib/formatter/WebpackFormatter.js:21:58)
    at configuration.logger.issues.error.issues.map (/app/node_modules/fork-ts-checker-webpack-plugin/lib/hooks/tapDoneToAsyncGetIssues.js:65:69)
    at Array.map (<anonymous>)
    at Object.<anonymous> (/app/node_modules/fork-ts-checker-webpack-plugin/lib/hooks/tapDoneToAsyncGetIssues.js:65:54)
    at Generator.next (<anonymous>)
(node:328) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

Expected behavior

Expected behavior would be getting notified of issues as normal

Steps to reproduce the issue

webpack.config.development.js:

module.exports = {
  context: `${process.cwd()}/client/`, // to automatically find tsconfig.json
  entry: './src/index.tsx',
  devtool: 'inline-source-map',
  plugins: [
    new ForkTsCheckerWebpackPlugin({
      eslint: {
        enabled: true,
        files: './src/**/*.{tsx,ts}',
        options: {
          extensions: ['.js', '.ts', '.tsx'],
          cache: true,
        },
      },
      typescript: {
        enabled: true,
        profile: false,
      },
    }),
    new ForkTsCheckerNotifierWebpackPlugin({
      title: 'TypeScript',
      excludeWarnings: false,
    }),
  ],
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: {
          loader: 'ts-loader',
          options: {
            transpileOnly: true,
            getCustomTransformers: () => ({
              before: [tsImportPluginFactory({ style: 'css' })],
            }),
          },
        },
        exclude: /node_modules/,
      },
    ],
  },
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'build'),
    publicPath: '/',
  },
  devServer: {
    clientLogLevel: 'warning',
    open: true,
    historyApiFallback: true,
    stats: 'errors-only',
    host: '0.0.0.0',
    port: 8080,
  },
  watchOptions: {
    ignored: /node_modules/,
    aggregateTimeout: 300,
    poll: 500,
  },
};

Command being run: webpack-dev-server --progress --color --mode development --config ./client/webpack.config.development.js

Environment

  • fork-ts-checker-webpack-plugin: 5.2.0
  • fork-ts-checker-notifier-webpack-plugin: 3.0.0
  • typescript: 4.0.2
  • eslint: 7.9.0
  • webpack: 4.44.1

    • webpack-dev-server: 3.11.0

  • os: macOS Catalina 10.15.5

Docker versions:
image

bug

Most helpful comment

I am having this same issue. Its definitely a bug as you shouldn't have to rebuild your project for fork-ts-checker to not crash.

Could you please reopen this?

All 2 comments

This appears to have been solved by rebuilding dependencies, closing for now.

I am having this same issue. Its definitely a bug as you shouldn't have to rebuild your project for fork-ts-checker to not crash.

Could you please reopen this?

Was this page helpful?
0 / 5 - 0 ratings