-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Persistent caching errors when a packfile is > 2GB #14907
Comments
@jpm4 When you do initial run, do you have any warnings/errors in console? |
@alexander-akait Here's all the snipped output that has warnings. Only including part of the Serialization timings for the one chunk that gets an "e". All seems okay?
|
It can be problem... Can you trace deprecation problems? Because using deprecation API can break cache potentially, maybe some plugin(s) doesn't support webpack5? |
@alexander-akait we resolved the deprecation warning and see the same issues |
@jpm4 Oh, I see another problem - |
If you set |
This sounds more like a problem in webpack rather than your configuration... |
I am afraid that cache-loader can break module, we have a lot of dirty solutions in code |
@alexander-akait we removed |
Just for information and ideas, can you run |
@alexander-akait here it is:
(apologies for OS oversight in initial report, hopefully doesn't all come down to that!) |
Very strange what you don't have plugins and loaders here, only |
@alexander-akait yes this is a monorepo however this is already in the main project root. The full list may be hidden because we wrap webpack? Do you want plugin/loader list and versions? |
Yes, |
Also there is one interesting thing - |
@alexander-akait here are dependencies with
Regarding |
Should be no, but yarn register own hooks on Node.js side, some things can be different, but if you don't use PnP, all should work without problems, anyway will be great to check it. Does the problem happen only for Also can you add |
|
@jpm4 hm, webpack has Can you show |
@alexander-akait First item: Second item (truncated and sanitized):
This is all code from a react component library inside the monorepo. This chunk appears to start midway through the module and continues to the end. Anything in particular that could be suspicious in here that I can give more info on? Do you expect this particular piece of It might be some time until we can get to your other suggestions with holidays coming up etc. |
I think we have some unexpected value in data, maybe related to unicode characters or weird characters (it can be generated by babel or webpack itself), this is why the logging looks strange, let's look on another thing, can you show |
That |
btw. we have a test case with a 4gb cache file in the test suite that seem to work fine |
@jpm4 - I have an error that is in many ways similar to yours. Mine is also a large app in a monorepo (GatsbyJS Project). I have thousands of errors in the console only in a warm development build when my pack file is larger than 2GB. Once my pack file goes below 2GB, I have a clean build without errors. Example Errors - The errors below are similar to yours, and are a few thousands lines:
Other relevant information:webpack version: 5.65.0 Can you please share if you have found the fix for this bug. |
Yep, sounds like a bug |
I think I'm reproduced this bug.. or another one.. |
Bug report
What is the current behavior?
We have a large app in a monorepo. Turning on filesystem caching for the client bundle is fine and shows great speed improvement. With SSR, we have ~100 entrypoints - the first run appears to cache without error, but on warm runs (with no code changes) we've observed errors thrown from a number of different places (seeming to depend on the size and state of master, and perhaps other settings/package bumps). I would guess however that all are the same root cause having to do with the caching going bad somewhere.
Example errors - in each case I'm just posting the first of thousands that spam the console:
Believe we also got a
TypeError: Cannot read property 'deserialize' of undefined
at some point.I tried bisecting our bundles to see if there was a bad one. As far I can tell there is not, but this did reveal that when we build a "small" enough number of bundles (25-40 out of the 100 depending on size) everything seems to be fine. Finally I tracked down what I think is a big clue; if one of the pack files is > 2GB, that's when we get a problem.
I did experiment with the number of entrypoints to make a packfile just over or under 2GB (the examples above are more extreme) and that seems to be the key factor. Note also in console errors that the preceding
starting to restore cache content 2 (2.03 GiB)
line is always > 2GB. This all seems like it could be closely related to #12126 and #12191. However it is certainly possible this is a coincidence or red herring.If the current behavior is a bug, please provide the steps to reproduce.
Given the complexity/size of our app and config I'm not sure I'll be able to provide a repro but I'll give what I can if you need it.
What is the expected behavior?
Persistent caching on a large app should work with no or minimal errors
Other relevant information:
webpack version: 5.62.1 (also tried out 5.64.4)
Node.js version: 14.9.0
Operating System: MacOS
Originally posted by @jpm4 in #14906
The text was updated successfully, but these errors were encountered: