diff --git a/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js b/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js index 816b9f2a73185..59723c903f642 100644 --- a/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js +++ b/packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js @@ -277,8 +277,14 @@ export default class ReactFlightWebpackPlugin { chunkGroup.chunks.forEach(function (c) { // eslint-disable-next-line no-for-of-loops/no-for-of-loops for (const file of c.files) { - if (!file.endsWith('.js')) return; - if (file.endsWith('.hot-update.js')) return; + if (!(file.endsWith('.js') || file.endsWith('.mjs'))) { + return; + } + if ( + file.endsWith('.hot-update.js') || + file.endsWith('.hot-update.mjs') + ) + return; chunks.push(c.id, file); break; }