Skip to content

Commit

Permalink
fix: add optional check while accessing webpack internals #2968 (#3120)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadaraUchiha-314 authored Oct 29, 2024
1 parent ad605d2 commit 87a2862
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chilly-experts-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/node': patch
---

add optional check while accessing webpack internals
2 changes: 1 addition & 1 deletion packages/node/src/utils/hot-reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const performReload = async (
}
});
//@ts-ignore
__webpack_require__.federation.instance.moduleCache.clear();
__webpack_require__?.federation?.instance?.moduleCache?.clear();
helpers.global.resetFederationGlobalInfo();
globalThis.moduleGraphDirty = false;
globalThis.mfHashMap = {};
Expand Down

0 comments on commit 87a2862

Please sign in to comment.