friendly-errors-webpack-plugin icon indicating copy to clipboard operation
friendly-errors-webpack-plugin copied to clipboard

TypeError: file.split is not a function

Open vmartins opened this issue 4 years ago • 1 comments

 ERROR  TypeError: file.split is not a function
TypeError: file.split is not a function
    at removeLoaders (/my/path/node_modules/@soda/friendly-errors-webpack-plugin/src/formatters/defaultError.js:23:22)
    at displayError (/my/path/node_modules/@soda/friendly-errors-webpack-plugin/src/formatters/defaultError.js:10:21)
    at /my/path/node_modules/@soda/friendly-errors-webpack-plugin/src/formatters/defaultError.js:39:20
    at Array.reduce (<anonymous>)
    at format (/my/path/node_modules/@soda/friendly-errors-webpack-plugin/src/formatters/defaultError.js:38:6)
    at format (/my/path/node_modules/@soda/friendly-errors-webpack-plugin/src/core/formatErrors.js:12:33)
    at Array.map (<anonymous>)
    at formatErrors (/my/path/node_modules/@soda/friendly-errors-webpack-plugin/src/core/formatErrors.js:15:21)
    at FriendlyErrorsWebpackPlugin.displayErrors (/my/path/node_modules/@soda/friendly-errors-webpack-plugin/src/friendly-errors-plugin.js:111:5)
    at doneFn (/my/path/node_modules/@soda/friendly-errors-webpack-plugin/src/friendly-errors-plugin.js:52:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/my/path/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
    at AsyncSeriesHook.lazyCompileHook (/my/path/node_modules/tapable/lib/Hook.js:154:20)
    at onCompiled (/my/path/node_modules/webpack/lib/Compiler.js:271:21)
    at /my/path/node_modules/webpack/lib/Compiler.js:681:15
    at eval (eval at create (/my/path/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:22:1)
    at runMicrotasks (<anonymous>)
  • @soda/friendly-errors-webpack-plugin: 1.8.0
  • webpack: 4.46.0

vmartins avatar Aug 23 '21 17:08 vmartins

I'm also seeing this error while building for production. In my case it seems to be caused by something to do with webpack's LimitChunkCountPlugin, if I remove it then the errors are gone and the build succeeds.

https://github.com/sodatea/friendly-errors-webpack-plugin/blob/master/src/formatters/defaultError.js#L23

timhere avatar Jun 01 '22 15:06 timhere