From 21d93e97fa31ea3eb7c083663230fcfff5aef691 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 11 Dec 2025 03:24:19 +0000 Subject: [PATCH] fix: Change unknown bun:bundle export from warning to error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Unknown exports from "bun:bundle" now produce an error instead of a warning - Remove unnecessary comment in visitStmt.zig 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/ast/P.zig | 3 +-- src/ast/visitStmt.zig | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ast/P.zig b/src/ast/P.zig index a9a48018d4..0bfdd9b6a7 100644 --- a/src/ast/P.zig +++ b/src/ast/P.zig @@ -2679,8 +2679,7 @@ pub fn NewParser_( const ref = try p.declareSymbol(.other, item.name.loc, name); p.bundler_feature_flag_ref = ref; } else { - // Warn about unknown specifiers - try p.log.addWarningFmt(p.source, item.alias_loc, p.allocator, "\"bun:bundle\" only exports \"feature\"; \"{s}\" will be undefined", .{item.alias}); + try p.log.addErrorFmt(p.source, item.alias_loc, p.allocator, "\"bun:bundle\" has no export named \"{s}\"", .{item.alias}); } } // Return empty statement - the import is completely removed diff --git a/src/ast/visitStmt.zig b/src/ast/visitStmt.zig index f85544a71d..6280c4d39e 100644 --- a/src/ast/visitStmt.zig +++ b/src/ast/visitStmt.zig @@ -40,9 +40,6 @@ pub fn VisitStmt( const visitors = struct { pub fn s_import(noalias p: *P, noalias stmts: *ListManaged(Stmt), noalias stmt: *Stmt, noalias data: *S.Import) !void { - // Note: `import { feature } from "bun:bundle"` is handled at parse time - // in processImportStatement(), not here at visit time. - try p.recordDeclaredSymbol(data.namespace_ref); if (data.default_name) |default_name| {