mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
esm.sh's build pipeline returns HTTP 500 for packages that ship only TypeScript types with an effectively-empty runtime JS file (e.g. @solana/rpc-parsed-types, pulled in transitively by @solana/kit). The esm plugin treated this as fatal, blocking any project depending on such a package. When an esm.sh JS module fetch fails, fall back to jsDelivr's +esm endpoint to inspect the package's actual runtime. If it is effectively empty (no exports/imports/code after stripping comments, prologues, and source-map directives), synthesize an empty ES module so the build can proceed. Genuine non-empty failures are still re-thrown unchanged, and the fallback is scoped to JS module requests only (asset/CSS/JSON failures remain fatal).