Fix mainBundle being passed as array in dev mode

Values in the assetsByChunkName object are arrays not strings.  This
caused the dev mode to fail after 2f4e0c4418 added an additional step
filtering out the static/ prefix from what it expected to be a string.
This commit is contained in:
Hornwitser committed 2026-09-11 19:59:41 +02:00
1 parent 9d061a0f53
commit a025d01294
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1237,7 +1237,7 @@ export default class Controller {
mainBundle = res.app.locals.mainBundle;
} else {
let stats = res.locals.webpack.devMiddleware.stats.stats[0];
mainBundle = stats.toJson().assetsByChunkName["main"];
mainBundle = stats.toJson().assetsByChunkName["main"][0];
}
mainBundle = routes.stripStaticPrefix(mainBundle);
+1 -1
View File
@@ -126,7 +126,7 @@ function getPlugins(req: Request, res: Response) {
let devPlugins = req.app.locals.devPlugins;
if (devPlugins && devPlugins.has(name)) {
let stats = res.locals.webpack.devMiddleware.stats.stats[devPlugins.get(name)!];
web.main = stats.toJson().assetsByChunkName[name];
web.main = stats.toJson().assetsByChunkName[name][0];
} else if (pluginInfo.manifest) {
web.main = pluginInfo.manifest[`${pluginInfo.name}.js`];
if (!web.main) {