Skip to content

Webpack 5.66.0: "Serializing big strings" warnings #15219

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

Closed
AprilArcus opened this issue Jan 21, 2022 · 1 comment · Fixed by #15222
Closed

Webpack 5.66.0: "Serializing big strings" warnings #15219

AprilArcus opened this issue Jan 21, 2022 · 1 comment · Fixed by #15222

Comments

@AprilArcus
Copy link

Bug report

Starting with Webpack 5.66.0, my build began to issue these warnings:

<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (112kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (109kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)

I bisected the problem to 8ae9507, "add support for url() in css". The previous commit (on both master and the feature/css-modules branch, 77b5589, does not issue the warning.

experiments.css is not enabled; all CSS is handled by a typical chain of [email protected], [email protected], [email protected], and [email protected], and the slightly less typical @teamsupercell/[email protected] (all versions latest). Removing the exotic typings-for-css-modules-loader did not resolve the issue.

What is the current behavior?

Warning regarding serializing large strings is emitted. Warning is unexpected based on webpack commit history and setting, and steps to resolve are unclear.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

If the warning is not legitimate for style-loader, do not emit a warning.
If the warning is legitimate, provide instructions directing the user to the provenance of the oversized string.

Other relevant information:
webpack version: 5.66.0
Node.js version:
Operating System: Linux
Additional tools: [email protected], [email protected], [email protected], [email protected], @teamsupercell/[email protected]

Possibly related to webpack-contrib/mini-css-extract-plugin#643, but note that my build does not use any text extraction plugins

@sokra
Copy link
Member

sokra commented Jan 21, 2022

Good bisecting work. That commit adds an problematic piece of code. It store the encoded data url of an asset module in the code generation result, which is serialized. For large enough data urls this will trigger the warning now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants