Skip to content

Webpack 5 HMR plugin error in runtime.[hash].hot-update.js #11670

@SPWizard01

Description

@SPWizard01

Bug report

What is the current behavior?
i am not sure whether this is webpack-dev-server issue or webpack or something else, however after 1st hot reload happens there is a constant error:

jsonp chunk loading:103 Uncaught TypeError: Cannot read property 'push' of undefined
    at self.webpackHotUpdatePACKAGEJSONNAME (jsonp chunk loading:103)
self["webpackHotUpdatePACKAGEJSONNAME"] = (chunkId, moreModules, runtime) => {
	for(var moduleId in moreModules) {
		if(__webpack_require__.o(moreModules, moduleId)) {
			currentUpdate[moduleId] = moreModules[moduleId];
			if(currentUpdatedModulesList) currentUpdatedModulesList.push(moduleId);
		}
	}
	if(runtime) currentUpdateRuntime.push(runtime); // error happens here
	if(waitingUpdateResolves[chunkId]) {
		waitingUpdateResolves[chunkId]();
		waitingUpdateResolves[chunkId] = undefined;
	}
};

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

launch dev-server with hot:true

What is the expected behavior?
does not happen in webpack@4
i think that the issue is that this variable currentUpdateRuntime is accessed before it is initialized in:
__webpack_require__.hmrI.jsonp
or
__webpack_require__.hmrC.jsonp

Other relevant information:
webpack version: 5.1.0
Node.js version: v12.18.0
Operating System: Windows 10
Additional tools:
webpack-devs-server@latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions