Skip to content

Commit 87a2862

Browse files
fix: add optional check while accessing webpack internals #2968 (#3120)
1 parent ad605d2 commit 87a2862

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/chilly-experts-walk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/node': patch
3+
---
4+
5+
add optional check while accessing webpack internals

packages/node/src/utils/hot-reload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export const performReload = async (
168168
}
169169
});
170170
//@ts-ignore
171-
__webpack_require__.federation.instance.moduleCache.clear();
171+
__webpack_require__?.federation?.instance?.moduleCache?.clear();
172172
helpers.global.resetFederationGlobalInfo();
173173
globalThis.moduleGraphDirty = false;
174174
globalThis.mfHashMap = {};

0 commit comments

Comments
 (0)