diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index 289e1dee0d..3eed87345b 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -61,6 +61,11 @@ pub const StackTrace = struct { options: std.fmt.FormatOptions, writer: anytype, ) !void { + // TODO: re-evaluate whether to use format() methods at all. + // Until then, avoid an error when using GeneralPurposeAllocator with WebAssembly + // where it tries to call detectTTYConfig here. + if (builtin.os.tag == .freestanding) return; + _ = fmt; _ = options; var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);