michaelwittig / node-q

Q interfacing with Node.js
MIT License
52 stars 14 forks source link

Fix TS issue TS2688/TS2304 #58

Closed dthevenin closed 3 years ago

dthevenin commented 3 years ago

Issue

When trying to compile a Typescript project that use node-q module, I get these error:

fix

Remove references to Long that does not exist in TypeScript; usenumber instead

dthevenin commented 3 years ago

Adding #@types/long" in my project dependencies did fix the issue. I will close this PR that does not make sense anymore.

Maybe you could document that dependencies for typescript users.

michaelwittig commented 3 years ago

@dthevenin @types/long is a dev dependency? I'm not sure if that's the right place. Not using TS.

dthevenin commented 3 years ago

@dthevenin @types/long is a dev dependency? I'm not sure if that's the right place. Not using TS.

@michaelwittig somehow my TS project fail to compile with the module node-q. I found 2 solutions to fix the issue (actually I did not investigate the real root cause):

I think at the end, since the project seems to work without using the type long, we should remove it. But I don't Know why we have that at the first place. Do you remember the rational behind that dependency?

michaelwittig commented 3 years ago

A q long can not always be represented as a JS Number.

From the README:

5: You can disable long2number deserialization during connect(params, cb) to represent longs as long.js.

somewhat related #48

dthevenin commented 3 years ago

interesting. I will investigate how to support properly long with JS big int.

Let's keep that PR open.