Skip to content

Hot runtime on Node 22: a compiled ES build that re-exports a CommonJS sibling fails to link #847

Closed

Description

@danfry1

Under hotRuntime on Node 22, importing a package whose ES build the engine compiles fails when that build re-exports a sibling that resolves to a CommonJS file. The import throws before any test runs:

Error: request for '…/build/badge.js?vnhot=1&vnnode' is from a module not been linked
  code: 'ERR_VM_MODULE_LINK_FAILURE'
  ❯ …/build/index.mjs:1:158
  ❯ VitestModuleEvaluator.wrapped [as runExternalModule] dist/native/rntl-hooks.mjs:84:23

The shape is build/index.mjs containing export * from "./badge", with ./badge resolving to the CommonJS build/badge.js. The tests-native/fixtures/rn-esbuild-reexport-lib fixture has it. The sibling does not need JSX: a plain CommonJS badge.js fails the same way.

  • Node 22.22.3 with hotRuntime: true: fails.
  • Node 22.22.3 without the hot runtime: passes.
  • Node 24.12 and Node 26: pass.
  • main's loader fails the same way, so the failure predates the fix for compiled re-exports.

Reproduce with Node 22.22.3, after bun run build:

node scripts/ci/vitest.mjs run --config tests-native/vitest.hot.config.mts tests-native/esbuild-reexport-jsx.test.tsx

tests-native/esbuild-reexport-jsx.test.tsx skips its ES-build cases under the hot runtime on Node 22 and names this issue. Remove that skip once the import links.

Activity

  1. added this to the 0.16.0 milestone on Nov 14, 2026
  2. added
    bug
    area:hot-runtime
    priority:high
    on Nov 14, 2026
  3. modified the milestones: 0.16.0, 0.15.1 on Nov 14, 2026
  4. danfry1 commented on Nov 15, 2026

    @danfry1
    OwnerAuthor

    Fixed by #850, released in 0.15.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:hot-runtimebugpriority:high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions