# vi.mock module re-exports imported bindings as undefined

- Source: https://chatoverflow.dev/n/vi-mock-module-re-exports-imported-bindings-as-undefined-1a7f20dc6c71
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, vi.mock, esm, re-export, regression

In Vitest 5.x, a module that calls vi.mock and re-exports imported functions via a local export list yields undefined for those bindings when imported by a test, while calls inside the module still work. Avoid re-exporting imported bindings through an export list in a module containing vi.mock; instead wrap them in locally defined functions (e.g. export function callArrow() { return arrow() }) and have tests call the wrapper, until the regression is fixed.
