question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Webpack5] split-chunks-plugin: automaticNameMaxLength param considered invalid during schema validation

See original GitHub issue

Bug report

What is the current behavior? The document for Webpack v5.0.0-beta.14 shows: https://webpack.js.org/plugins/split-chunks-plugin/#splitchunksautomaticnamemaxlength

If the current behavior is a bug, please provide the steps to reproduce. add the following to webpack config:

config.optimization = {
      runtimeChunk: "single",
      splitChunks: {
         automaticNameMaxLength: 250
     }
}

Following error is seen:

message: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.optimization.splitChunks has an unknown property 'automaticNameMaxLength'. These properties are valid:
object { automaticNameDelimiter?, cacheGroups?, chunks?, fallbackCacheGroup?, filename?, hidePathInfo?, maxAsyncRequests?, maxAsyncSize?, maxInitialRequests?, maxInitialSize?, maxSize?, minChunks?, minRemainingSize?, minSize?, name? }

But that particular option is not seen in the code of v5.0.0-beta.14 tag Ref: https://github.com/webpack/webpack/blob/master/lib/optimize/SplitChunksPlugin.js#L499

What is the expected behavior? As in the above mentioned document URL lists the support, it should work as in v4 If not, is there any default/alternate behavior for the same option? or will it removed from the document page?

Other relevant information: webpack version: v5.0.0-beta.14 Node.js version: v10.16.0 Operating System: macOS Mojave v10.14.6 Additional tools: N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sokracommented, Apr 1, 2020

automatic naming has been removed from splitChunks. It’s actually bad for caching.

For development optimization.chunkIds: "named" is the default and generates a useful name. For production you are better when using a numeric id or a hash.

0reactions
gaurav5430commented, Jan 7, 2022

why is automatic naming bad for caching ?

for production, we explicitly name our chunks using magic comments, is that bad as well ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SplitChunksPlugin - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
A validationError when I upgrade webpack from v4 to v5
According to https://webpack.js.org/configuration/module/#condition, passing your RegExp to issuer may fix this. change this
Read more >
Webpack: An in-depth introduction to SplitChunksPlugin
This article will give you a good introduction to one of the most used plugins in webpack's ecosystem - SplitChunksPlugin.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found