diff --git a/src/bundler/bundle_v2.zig b/src/bundler/bundle_v2.zig index 41f7c3e178..ee5e6056bb 100644 --- a/src/bundler/bundle_v2.zig +++ b/src/bundler/bundle_v2.zig @@ -1945,7 +1945,7 @@ pub const ParseTask = struct { switch (err) { error.FileNotFound => { log.addErrorFmt( - &Logger.Source.initEmptyFile(file_path.text), + &Logger.Source.initEmptyFile(log.msgs.allocator.dupe(u8, file_path.text) catch unreachable), Logger.Loc.Empty, allocator, "File not found {}", @@ -1954,7 +1954,7 @@ pub const ParseTask = struct { }, else => { log.addErrorFmt( - &Logger.Source.initEmptyFile(file_path.text), + &Logger.Source.initEmptyFile(log.msgs.allocator.dupe(u8, file_path.text) catch unreachable), Logger.Loc.Empty, allocator, "{s} reading file: {}",