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
Here, the first log output is identical to the .js one, so I know the same correct thing is getting pulled in and it's actually reading the js source (since it prints out SetlistFmApi). The second one is undefined though. So something to do with how javascript handles its default exports compared to typescript gets the wires crossed somewhere in there.
I've used js libraries with typescript before, so I know it can be done. I just don't know enough about the package ecosystem of both to know what's messed up here. Any thoughts? Happy to put up a PR if you can just point me in the direction of a cross-compatible fix.
The text was updated successfully, but these errors were encountered:
Hey,
I'm trying to use this .js npm package from within a .ts, but there some way that the exports are set up that it's really not liking.
The default setup of this library in a regular node.js file run from the command line:
That first
console.log(sim)
prints[Function: SetlistFmApi]
. The second one,console.log(client)
prints:Perfect! Everything looks good there. Now here's the same example from within typescript (note the slightly different import syntax).
Here, the first log output is identical to the .js one, so I know the same correct thing is getting pulled in and it's actually reading the js source (since it prints out SetlistFmApi). The second one is
undefined
though. So something to do with how javascript handles its default exports compared to typescript gets the wires crossed somewhere in there.I've used js libraries with typescript before, so I know it can be done. I just don't know enough about the package ecosystem of both to know what's messed up here. Any thoughts? Happy to put up a PR if you can just point me in the direction of a cross-compatible fix.
The text was updated successfully, but these errors were encountered: