revert sourcemap-related logging change (#11510)

This commit is contained in:
dave caruso
2024-05-31 23:26:43 -07:00
committed by GitHub
parent 0a5fa2dd8c
commit 18bba0dc44
2 changed files with 17 additions and 39 deletions

View File

@@ -286,7 +286,6 @@ pub const Mapping = struct {
base_filename,
lookup.source_map.underlying_provider.load_hint,
.{ .source_only = @intCast(index) },
null,
)) |parsed|
if (parsed.source_contents) |contents|
break :bytes contents;
@@ -723,7 +722,6 @@ pub const SourceProviderMap = opaque {
source_filename: []const u8,
load_hint: SourceMapLoadHint,
result: ParseUrlResultHint,
log: ?*Logger.Log,
) ?SourceMap.ParseUrl {
var sfb = std.heap.stackFallback(65536, bun.default_allocator);
var arena = bun.ArenaAllocator.init(sfb.get());
@@ -781,18 +779,14 @@ pub const SourceProviderMap = opaque {
data,
result,
) catch |err| {
if (log) |l|
l.addWarningFmt(
null,
Logger.Loc.Empty,
bun.default_allocator,
"Could not decode sourcemap '{s}': {s}",
.{
source_filename,
@errorName(err),
},
) catch {};
// Disable the "try using --sourcemap=external" hint
// Print warning even if this came from non-visible code like
// calling `error.stack`. This message is only printed if
// the sourcemap has been found but is invalid, such as being
// invalid JSON text or corrupt mappings.
bun.Output.warn("Could not decode sourcemap in '{s}': {s}", .{
source_filename,
@errorName(err),
}); // Disable the "try using --sourcemap=external" hint
bun.JSC.SavedSourceMap.MissingSourceMapNoteInfo.seen_invalid = true;
return null;
},
@@ -800,17 +794,10 @@ pub const SourceProviderMap = opaque {
}
if (inline_err) |err| {
if (log) |l|
l.addWarningFmt(
null,
Logger.Loc.Empty,
bun.default_allocator,
"Could not decode sourcemap in '{s}': {s}",
.{
source_filename,
@errorName(err),
},
) catch {};
bun.Output.warn("Could not decode sourcemap in '{s}': {s}", .{
source_filename,
@errorName(err),
});
// Disable the "try using --sourcemap=external" hint
bun.JSC.SavedSourceMap.MissingSourceMapNoteInfo.seen_invalid = true;
return null;