File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
apps/docs/src/en/modules/ROOT/pages/core-features Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ module.exports = {
95
95
----
96
96
// Fetch Remote A dynamically:
97
97
const fetchRemoteA = (resolve) => {
98
+ const fetchRemoteA = (resolve, reject) => {
98
99
// We define a script tag to use the browser for fetching the remoteEntry.js file
99
100
const script = document.createElement("script");
100
101
script.src = window.appAUrl; // This could be defined anywhere
@@ -112,10 +113,14 @@ const fetchRemoteA = (resolve) => {
112
113
},
113
114
};
114
115
resolve(module);
115
- }
116
+ };
117
+ // Reject promise in case of network error
118
+ script.onerror = () => {
119
+ reject(new Error('Remote A init error'));
120
+ };
116
121
// Lastly we inject the script tag into the document's head to trigger the script load
117
122
document.head.appendChild(script);
118
- }
123
+ };
119
124
----
120
125
121
126
=== Advantages and Limitations
You can’t perform that action at this time.
0 commit comments