0x706b / fncts

A collection of hard forks, ports, re-imaginations, and original code to fuel my own learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reference Error when importing @fncts/control/Z

Walexander opened this issue · comments

I get the following runtime error when importing @fncts/base/control/Z

file:///...../fncts/packages/base/build/esm/control/Z/instances.js:7
    map: map_,
         ^
ReferenceError: Cannot access 'map_' before initialization

This looks to be due to a circular dependency between data/Cause/api/unified.ts and typeclass/Showable. Madge shows:

base/build/esm/typeclass/Showable.js > base/build/esm/typeclass/Showable/show.js > base/build/esm/control/Z/api.js > base/build/esm/data/Cause/api.js > base/build/esm/data/Cause/api/prettyPrint.js > base/build/esm/data/Cause/api/unified.js

I'm happy to send a PR but would need some guidance on the best place in the chain to break the cycle.

Thanks for the issue! I believe it is fixed with the linked PR, and I'll release a patch.