Midnight Wallet SDK Has Five Bugs That Break Fresh Installs — Here Are the Patches
Developers using the Midnight blockchain wallet SDK encounter recurring crashes after a fresh npm install, caused by bugs across five packages in versions including wallet-sdk-shielded 3.0.2 and facade 4.1.0. The root cause is that the SDK's custom ledger types return plain iterators lacking helper methods like .map() and .filter(), which are available on native JavaScript Map and Set objects but were never implemented in the SDK's custom types. This means errors such as 'TypeError: state.pendingOutputs.values.map is not a function' appear consistently regardless of the Node.js version being used. The fix involves converting plain iterators into arrays before chaining methods, applied via sed commands or Node scripts to the affected compiled files in node_modules. Because npm install overwrites these files, the patches must be manually re-applied each time dependencies are installed until an official SDK update is released.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in