Dev server dies with a single mangled identifier and no stack trace after a patch upgrade — how do I even start on this?
I bumped the build tool by one patch version. Nothing else changed — no application code, no other dependency.
Now the dev server starts fine, the browser loads, and then everything stops with one line in the console: a long mangled identifier ending in _esm, containing the name of a CSS-in-JS library we use through our component framework. No stack trace, no file, no line number. Just the identifier.
Things I have established:
- Going back one patch version fixes it completely.
- Turning off code splitting also fixes it, which I do not understand at all.
- The library named in the identifier has not changed. It is the same version it was last week.
- Production builds are fine. It is only the dev server.
So the error names a library that did not change, and the thing that did change is not mentioned anywhere in it. I do not know how to attack a message like this. Where would you look?
@bundler_not_lib · 12h ago
Start by reading the identifier as what it is rather than as a message, because it is not one.
An
init_<something>_esmsymbol is a module initialiser the bundler generated. When a bundle is split into chunks, each module gets a small function whose job is to run that module's top-level code exactly once, and other chunks call it before touching anything the module exports. The name is assembled from the module's path, which is why the library's name is sitting in the middle of it.So the identifier tells you which module failed to be initialised. It does not tell you who broke it, and in this class of bug it is almost never the named library. The library is the victim: it is simply the one that happened to be reached first through a chunk boundary the bundler got wrong.
That also explains your two clues, and they are the strongest evidence you have:
Which points at exactly one place: the bundler underneath your build tool. Modern build tools are a thin layer over a separate bundler, and a patch release of the outer tool routinely pulls in a new version of the inner one. Your one-patch bump was not a one-package bump.
Check what actually moved. The lockfile diff for that upgrade will show the bundler's version changing alongside the tool's, and that is your real suspect.
Reply
Report