Webpack errors are not logged
See original GitHub issueI’m submitting a feature request
Webpack version: 2.x
Webpack Karma version: 2.0.x
Karma version: 1.x
Please tell us about your environment: OSX 10.x
Current behavior: karma-webpack do not log webpack configuration issues. Simply reports
26 02 2017 22:08:57.640:ERROR [preprocess]: Can not load "webpack"!
Error
at webpack (..../node_modules/webpack/lib/webpack.js:19:9)
code here https://github.com/webpack-contrib/karma-webpack/blob/v2/src/karma-webpack.js#L65
Expected/desired behavior: Instead karma-webpack should catch expcetion thrown by webpack and log message on exception.
Replacing above line with
var compiler;
try {
compiler = webpack(webpackOptions);
} catch(e) {
console.error(e.message);
throw e;
}
Report is
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module has an unknown property 'preLoaders'. These properties are valid:
object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, loaders?, noParse?, rules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
Options affecting the normal modules (`NormalModuleFactory`).
- configuration.resolve.extensions[0] should not be empty.
26 02 2017 22:08:57.640:ERROR [preprocess]: Can not load "webpack"!
Error
at webpack (..../webpack/lib/webpack.js:19:9)
- What is the motivation / use case for changing the behavior? Make easier to resolve webpack configuration issues.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Webpack errors are not logged · Issue #227 - GitHub
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration.
Read more >Angular 2 & Webpack: Most errors not logged to the console
I've noticed that errors thrown by angular are not being logged to the console since I switched to Webpack. Does anybody know how...
Read more >How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >KJS / Gradle: webpack plugin errors not logged : KT-50442
Error occurred. See log for details. * Try: Run with --info or --debug option to get more log output. Run with --scan to...
Read more >Other Options - webpack
By default webpack will log these errors in red in the terminal, ... Remember that current configuration will not compile until its dependencies...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@marcusellis05 - It’s next on my list after css-loader to go out. Couple of hours to npm
@d3viant0ne yes, i know. But, that is not point of this report. Could you reread this?
karma-webpack currently keeps this information hidden from user and reports only
Can not load "webpack"!. Which is not very informative and generates unneccessary support requests for you.