diff --git a/lib/services/log-source-map-service.ts b/lib/services/log-source-map-service.ts index 39d6012a53..ebac80ed5e 100644 --- a/lib/services/log-source-map-service.ts +++ b/lib/services/log-source-map-service.ts @@ -69,6 +69,15 @@ export class LogSourceMapService implements Mobile.ILogSourceMapService { if (!this.$fs.getFsStats(filePath).isDirectory()) { const mapFile = filePath + ".map"; let sourceMapRaw; + + // Skip files bigger than 50MB + if (this.$fs.getFileSize(filePath) > 50 * 1000 * 1000) { + this.$logger.trace( + `Skipping source map for file ${filePath} because it is too big (> 50MB).` + ); + return; + } + const source = this.$fs.readText(filePath); if (this.$fs.exists(mapFile)) { sourceMapRaw = sourceMapConverter.fromMapFileSource(