Skip to content

Commit 71a989b

Browse files
authored
fix: show source maps for MF2 remotes in DevTools (#1168)
* fix: enable sourcemaps for mf2 remotes * chore: changeset
1 parent b26e44d commit 71a989b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.changeset/mean-webs-travel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@callstack/repack-dev-server": patch
3+
---
4+
5+
Fix React Native DevTools not showing source maps for MF2 remotes

packages/dev-server/src/createServer.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,25 @@ export async function createServer(config: Server.Config) {
8181
return;
8282
}
8383
} else {
84-
instance.log.info(message);
84+
instance.log.debug(message);
8585
return;
8686
}
8787
},
8888
},
89+
// we need to let `Network.loadNetworkResource` event pass
90+
// through the InspectorProxy interceptor, otherwise it will
91+
// prevent fetching source maps over the network for MF2 remotes
92+
unstable_customInspectorMessageHandler: (connection) => {
93+
return {
94+
handleDeviceMessage: () => {},
95+
handleDebuggerMessage: (msg: { method?: string }) => {
96+
if (msg.method === 'Network.loadNetworkResource') {
97+
connection.device.sendMessage(msg);
98+
return true;
99+
}
100+
},
101+
};
102+
},
89103
unstable_experiments: {
90104
// @ts-expect-error removed in 0.76, keep this for backkwards compatibility
91105
enableNewDebugger: true,

0 commit comments

Comments
 (0)