From 620a45f4121d471406451280625ac10cac3541e5 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Tue, 29 Oct 2024 12:00:44 -0700 Subject: [PATCH] chore(compartment-mapper): Improve makeBundle diagnostics --- packages/compartment-mapper/src/bundle.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/compartment-mapper/src/bundle.js b/packages/compartment-mapper/src/bundle.js index 68adc32d21..c4b540e78d 100644 --- a/packages/compartment-mapper/src/bundle.js +++ b/packages/compartment-mapper/src/bundle.js @@ -113,8 +113,14 @@ const sortedModules = ( const source = compartmentSources[compartmentName][moduleSpecifier]; if (source !== undefined) { const { record, parser, deferredError, bytes } = source; - assert(parser !== undefined); - assert(bytes !== undefined); + assert( + bytes !== undefined, + `No bytes for ${moduleSpecifier} in ${compartmentName}`, + ); + assert( + parser !== undefined, + `No parser for ${moduleSpecifier} in ${compartmentName}`, + ); if (deferredError) { throw Error( `Cannot bundle: encountered deferredError ${deferredError}`,