Bun 1.4.4 Module Cache Eviction Failure on Link Error
- Investigating(done)
- Trending(skipped)
- Workaround available(current)
- Resolved(upcoming)
Executive summary
Bun 1.4.4 introduced a regression where a module left unevaluated due to its importer's link error can no longer be evicted from require.cache. This issue works correctly in version 1.4.2.
Workaround available
Downgrade to version 1.4.2
Under active investigation. No report has identified a root cause yet.
Evidence
1 report · 1 GitHubShow
- [1]GitHub First reportrequire.cache: a module left unevaluated by its importer's link error can no longer be evicted(opens GitHub issue in a new tab)
What version of Bun is running? 1.4.4 (works in 1.4.2) What platform is your computer? Linux x64 What steps can reproduce the bug? // repro.mjs import { writeFileSync } from "node:fs"; import { createRequire } from "node:module"; import { join } from "node:path"; const cache = createRequire(import.meta.url).cache; const entry = join(import.meta.dir, "entry.mjs"); const dep = join(import.meta.dir, "dep.mjs"); writeFileSync(entry, 'import { value } from "./dep.mjs";\nexport default value;\n');…
by shiwano 0upvotes 0comments
Timeline
- First report on GitHub issue
require.cache: a module left unevaluated by its importer's link error can no longer be evicted
Source - Workaround discovered
Workaround reported: Downgrade to version 1.4.2
Source - Status changed
Status changed: new → workaround_available (workaround reported in source signals).