You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With a reviver, a module that has no default export fails with "Unsupported type" (structuredClone of a module namespace) #38
area: coreTouches core library / runtime source codepriority: lowMinor issue or improvement that can be deferred without impactstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expected
When a reviver is passed and the loaded module has no default export, wisp falls back to the module namespace object and passes it through structuredClone. A module namespace can't be structured-cloned, so the call throws. That error gets caught and reported as wisp's generic "Unsupported type" error, which hides the real cause and fails a load that should either work or give a clear error.
Found while porting the suite to vitest-runner (#37). The new tests pin the current behaviour.
Fix
Decide the contract for a module without a default export when a reviver is given:
either apply the reviver to a plain-object copy of the namespace's own enumerable properties ({ ...ns }) rather than structuredClone(ns),
or throw a clear error saying a reviver needs a JSON value or a default export.
Then update the pinned test to the intended behaviour, for both wisp and wispSync where applicable.
area: coreTouches core library / runtime source codepriority: lowMinor issue or improvement that can be deferred without impactstatus: implementedBuilt and deployed, but not yet fully tested/verifiedtype: bugSomething is broken or not behaving as expected
Activity
fix: revive a namespace without a default export, and report a non-JS…
cldmv-bot commentedon Oct 4, 2026
Marked
status: implemented— resolved by #41, merged intonext. This issue closes automatically when that work ships to the default branch.release: v1.0.7 - require the ESM entry directly and fail clearly on…