stream-wormhole icon indicating copy to clipboard operation
stream-wormhole copied to clipboard

`TypeError: sendToWormhole is not a function` after upgrading to v2.0.1 using CommonJS require

Open lvboda opened this issue 9 months ago • 1 comments

This issue appears to be caused by a breaking change in the way the module is exported in v2.0.0. It seems that CommonJS require() no longer returns the function directly.

const sendToWormhole = require('stream-wormhole');
await sendToWormhole(stream);

// v1.1.0 ✅
// update to v2.0.1 ❌
// nodejs.TypeError: sendToWormhole is not a function

lvboda avatar Apr 15 '25 03:04 lvboda

Should change to export style:

const { sendToWormhole } = require('stream-wormhole');

export default not work on commonjs.

fengmk2 avatar Apr 15 '25 03:04 fengmk2