diff options
| author | 2021-12-04 03:26:14 -0800 | |
|---|---|---|
| committer | 2021-12-04 03:26:14 -0800 | |
| commit | b2fcc027a9e4eebd457d5248af3a3ce86b83c014 (patch) | |
| tree | 1f251cab097a72acba752c2ebe87a05eaf81818c /src/linker.zig | |
| parent | 1dc78ba4b70132afefeae8e9b830633cbd121bcb (diff) | |
| download | bun-b2fcc027a9e4eebd457d5248af3a3ce86b83c014.tar.gz bun-b2fcc027a9e4eebd457d5248af3a3ce86b83c014.tar.zst bun-b2fcc027a9e4eebd457d5248af3a3ce86b83c014.zip | |
[resolver] Do not throw on require()/import errors when they're caught (and import is an await target)
Diffstat (limited to 'src/linker.zig')
| -rw-r--r-- | src/linker.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/linker.zig b/src/linker.zig index b031952b2..533ffb544 100644 --- a/src/linker.zig +++ b/src/linker.zig @@ -329,10 +329,11 @@ pub const Linker = struct { import_record.module_id = @truncate(u32, std.hash.Wyhash.hash(0, path.pretty)); } } else |err| { - had_resolve_errors = true; - switch (err) { error.ModuleNotFound => { + if (import_record.handles_import_errors) continue; + had_resolve_errors = true; + if (import_record.path.text.len > 0 and Resolver.isPackagePath(import_record.path.text)) { if (linker.options.platform.isWebLike() and Options.ExternalModules.isNodeBuiltin(import_record.path.text)) { try linker.log.addResolveError( @@ -370,6 +371,8 @@ pub const Linker = struct { } }, else => { + had_resolve_errors = true; + try linker.log.addResolveError( &result.source, import_record.range, |
