metro
metro copied to clipboard
fix: apply custom serializer to source map endpoint in dev server
Summary
- The source maps for Expo CLI are off by 1, but only in development. The cause is that source maps are generated differently between the server endpoint and the
build
function. In the Expo metro-config, we use the serializer to inject custom pre-modules for things like SSR and client-side environment variables. These changes aren't reflected in the source map endpoint. - This PR addresses the differences by applying a custom serializer to the graph if one exists, and returning the map from the serializer if one is returned.
- The Expo CLI-side of this PR can be found here https://github.com/expo/expo/pull/29463
- This doesn't address the same issue occurring in error symbolication https://github.com/EvanBacon/metro/blob/f73d9f139343bdc67e03c78222ace3ec8f980304/packages/metro/src/Server.js#L1446
Changelog: [Fix] Apply custom serializer to source map graph in .map
endpoint.