Today's Trends
mediumWorkaround availableBunv1.4.4

Bun 1.4.4 Module Cache Eviction Failure on Link Error

  1. Investigating(done)
  2. Trending(skipped)
  3. Workaround available(current)
  4. 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

Reported inGitHubevidence [1]
Technical root cause

Under active investigation. No report has identified a root cause yet.

Evidence

1 report · 1 GitHubShow
  1. [1]
    GitHub First report
    require.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

  1. First report on GitHub issue

    require.cache: a module left unevaluated by its importer's link error can no longer be evicted

    Source
  2. Workaround discovered

    Workaround reported: Downgrade to version 1.4.2

    Source
  3. Status changed

    Status changed: new → workaround_available (workaround reported in source signals).