Comments (4)
the same issue
from friendly-errors-webpack-plugin.
Can you check if it is still the case with 2.0.0-beta.1
?
from friendly-errors-webpack-plugin.
We had a similar issue opened on the Webpack Encore repository (symfony/webpack-encore#593) that I can also reproduce using our master
branch (that targets 2.0.0-beta.1
).
When that happens stats.hasWarning()
returns true
so it goes into the following if
:
friendly-errors-webpack-plugin/src/friendly-errors-plugin.js
Lines 56 to 58 in 273ca3b
But stats.compilation.warnings
returns an empty array here:
Here is a repro provided by @uturnr if you want to take a look: https://github.com/uturnr/webpack-encore-repro-issue-593
from friendly-errors-webpack-plugin.
After looking at that issue a bit more I think it happens because the extractErrorsFromStats()
function stops at the first compilation object instead of also looking in its children.
I tried with the following code and now get WARNING Compiled with 1 warnings
, but still no warning message for some reason (it may be another issue though)...
Edit: Nevermind, it works fine, I had a small issue in my code!
I'll open a PR if I get the time to update the tests :)
function extractErrorsFromStats(stats, type) {
if (isMultiStats(stats)) {
const errors = stats.stats
.reduce((errors, stats) => errors.concat(extractErrorsFromStats(stats, type)), []);
// Dedupe to avoid showing the same error many times when multiple
// compilers depend on the same module.
return uniqueBy(errors, error => error.message);
}
const findErrorsRecursive = (compilation) => {
const errors = compilation[type];
if (compilation.children) {
for (const child of compilation.children) {
errors.push(...findErrorsRecursive(child));
}
}
return uniqueBy(errors, error => error.message);
};
return findErrorsRecursive(stats.compilation);
}
from friendly-errors-webpack-plugin.
Related Issues (20)
- Blank error when only webpackError property populated
- module is undefined
- show time even if warning appears
- Missing Error Filtering Feature
- Stylelint output does not show the name of the file where warnings occur
- Cannot read property 'request' of undefined at transform HOT 2
- Cannot read property 'some' of undefined
- Missing error report for failed compilation
- Can this plugin work with ForkTsChecker plugin when clearConsole is true? HOT 7
- Is 2.x ready for release? HOT 2
- compilationSuccessInfo.message not show HOT 1
- Peer Dependency issue with Webpack v5.x HOT 4
- Type 'FriendlyErrorsWebpackPlugin' is not assignable to type 'WebpackPluginInstance'.
- Forget update the Readme on NPM HOT 1
- Cannot read property 'startsWith' of undefined HOT 2
- Support for displaying compilationSuccessInfo only on initial compilation HOT 1
- Does not work with Node.js v12 HOT 2
- recommending a different eslint-loader formatter in the docs
- Compilation is always succesful when it should not be HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from friendly-errors-webpack-plugin.