Can you PLEASE improve the SplitChunksPlugin error message?

Feature request

What is the expected behavior?

Right now the error is:

Error: SplitChunksPlugin: You are trying to set a filename for a chunk which is (also) loaded on demand. The runtime can only handle loading of chunks which match the chunkFilename schema. Using a custom filename would fail at runtime. (cache group: default)

What is motivation or use case for adding/changing the behavior?

Often times this happens after a merge. Somewhere, someone on our team referenced a file. Someone, somewhere else, at some point in time, referenced the same component, but as an async import. Unfortunately this error message gives zero insight into what component or where this import was in conflict. We have no way of knowing aside from going through commit by commit to see what the SplitChunksPlugin is complaining about.

How should this be implemented in your opinion?

Tell us WHY this error occurred. What is the filename / chunk that is trying to be created? What is the source of this error?

Are you willing to work on this yourself?
no

Author: Fantashit

1 thought on “Can you PLEASE improve the SplitChunksPlugin error message?

  1. Why: You are trying to set a filename for a chunk which is (also) loaded on demand.

    Source: (cache group: default)

    The error doesn’t origin from a component. It’s an incorrect configuration. You are trying to set the filename where it’s not possible. Check either optimization.splitChunks.filename or optimization.splitChunks.cacheGroups.default.filename and remove it.

    Send a PR to improve it

Comments are closed.