-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Error objects, not strings, to compilation.warnings #2790
Comments
Well, the problem was with the I would suggest to update the documentation to make this point much more clear. Also, it could be a good idea to disable this filter by default entirely. I think that developer should be the one to explicitly determine if this rule should apply. Sadly, this option can't be even disabled without specifying a big numeric value there. |
I apologize for the frustration that this caused. Our current JSDoc to HTML generation pipeline unfortunately omits our documented default values, so while this is considered our "source of truth", it's not visible like it should be: workbox/packages/workbox-webpack-plugin/src/inject-manifest.js Lines 100 to 103 in 27080cc
(We have plans to switch to an alternative HTML generation process as part of a larger documentation migration.) The one mitigating point is that exclusions of entries from the precache manifest should be reported back to the workbox/packages/workbox-build/src/lib/maximum-size-transform.js Lines 19 to 21 in 27080cc
Is that warning what eventually led you to discover what was going on? |
I also faced the exact same issue this week. I didn't get a warning while compiling, I only discovered that option because of this thread. |
Thanks for letting us know. The intention is definitely for there to be a warning bubbled up that gets reported by |
Thanks for having a look! I'm using the following packages:
|
I tried to reproduce this with a basic
and the
Running the
That's what I would expect to see, and indicates that the warnings and logs from If you're using a wrapper like |
I agree that the warning would be enough to figure out what's going on. The issue must be coming from either mix or the plugin wrapper but I'm wondering why some warnings are showing up fine then. For example, this one is displayed without issue:
Is that message using a different method to display the warning? |
That specific warning comes from: workbox/packages/workbox-webpack-plugin/src/inject-manifest.js Lines 277 to 285 in 27080cc
The warning about the maximum file size, and any other warnings related to manifest entries, come from: workbox/packages/workbox-webpack-plugin/src/lib/get-manifest-entries-from-compilation.js Lines 193 to 203 in 27080cc
The main difference that I see is that we're adding I can't easily reproduce the build environment you have set up, so do you want to try making the following change to your local copy of your
|
That fix did make a difference, I can now see the warnings. Maybe it is related to how this package used by laravel-mix parses the errors and warnings? It looks like it hasn't been updated in a while. |
Okay, thanks for confirming. I can put together a PR that switches that code over to wrap the strings in |
That'd be great, thank you for your help and responding so quickly! |
...and now I remember that we made that change to some other parts of the codebase recently to resolve #2674, but it looks like that one line of code still was using strings directly. Sorry about that. |
Hello! Thank you for a quick and detailed response. I don't believe I saw the warning. At least not after I've figured this out by myself. The problem with warnings is that Webpack can generate a lot of messages and most developers are getting blind to it's output. I still believe that default settings should be more conservative. |
One way of looking at it, which has motivated the defaults that have been in place for five years or so now, is that accidentally forcing your users to precache, say, dozens of megabytes of image assets is not being conservative. There's a balance we have to strike between confusing developers who are unclear on why something isn't precached (and hopefully the warning messages help here) and confusing developers who hear from angry users about how their deployed web app downloads much more data than they expected the first time they visit it. |
Hello!
Library Affected:
workbox-webpack-plugin@6.1.2
I'm experiencing a situation, where the manifest, generated by the
InjectManifest
plugin doesn't include themain.js
file (this is a main and a single entry point of my application).I've tried to use the
webpack-manifest-plugin
and I can confirm that it's manifest correctly lists all the output files, including themain.js
one.I'm using latest Webpack
5.27.1
.Do you have an idea what could be causing this behavior? Thanks.
The text was updated successfully, but these errors were encountered: