`Never!!!` when checking code that uses npm dependency
I came across this one when I was trying to do a minimal-reproduction of another issue, so here's a repo that showcases the issue:
- https://github.com/easoncxz/hegel-bug-never-bang-bang-bang
(I use nodenv, and commited a .node-version file with 14.1.0.)
Steps:
$ git clone [email protected]:easoncxz/hegel-bug-never-bang-bang-bang.git
$ cd hegel-bug-never-bang-bang-bang
$ npm i
$ npx hegel # .hegelrc is already included in the commit
Expected:
[0] $ npx hegel
No errors!
[0] $
Actual:
[0] $ npx hegel
Never!!!
[1] $
([0]/[1] is the shell-prompt showing the exit-code of the previous command.)
The choice of using the chalk library was arbitrary; I just wanted to try a small npm package.
Hmm. Will try to find a problem and fix it soon. Thank you a lot.
Any updates on this?
Yeah, I found that problem is that Hegel tries to inference chalk module type instead of getting his types.
Seems like we need to understand TypeScript namespaces with Hegel (and we are working on it)
If you need to fix it fastly - you can add your own typings for chalk module in @types directory like this: https://gist.github.com/JSMonk/58cdad3f7de7dd5121d84a19cd415ae2