Skip to content

Commit b8dd205

Browse files
committed
feat(nf-runtime): don't fail bootstrapping if remote entry cannot be loaded
1 parent ef93d22 commit b8dd205

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

libs/native-federation-runtime/src/lib/init-federation.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@ async function processRemoteInfos(
4040
};
4141

4242
for (const remoteName of Object.keys(remotes)) {
43-
const url = remotes[remoteName];
44-
const remoteMap = await processRemoteInfo(url, remoteName);
45-
importMap = mergeImportMaps(importMap, remoteMap);
43+
try {
44+
const url = remotes[remoteName];
45+
const remoteMap = await processRemoteInfo(url, remoteName);
46+
importMap = mergeImportMaps(importMap, remoteMap);
47+
} catch (e) {
48+
console.error(`Error loading remote entry for ${remoteName} from file ${remotes[remoteName]}`);
49+
}
4650
}
4751

4852
return importMap;

update-local.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
call npm unpublish @softarc/native-federation@1.0.0 --registry http://localhost:4873
2+
call npm unpublish @softarc/native-federation-runtime@1.0.0 --registry http://localhost:4873
3+
24
call npm unpublish @angular-architects/native-federation@1.0.0-beta.1 --registry http://localhost:4873
35
call nx build native-federation
46
call nx build native-federation-core
7+
call nx build native-federation-runtime
8+
59
call npm publish dist\libs\native-federation-core --registry http://localhost:4873
610
call npm publish dist\libs\native-federation --registry http://localhost:4873
11+
call npm publish dist\libs\native-federation-runtime --registry http://localhost:4873

0 commit comments

Comments
 (0)