NATS & Angular 6
See original GitHub issueHi,
I’ve been attempting to get ts-nats working in a new Angular 6 project in order to set up a PoC for playing around with and testing NATS capabilities from a browser.
However, I keep getting this compilation error:
ERROR in ./node_modules/ts-nats/lib/tcptransport.js
Module not found: Error: Can't resolve 'net' in 'C:\Source\NATS\TSClient\nats-ts-client-six\node_modules\ts-nats\lib'
ERROR in ./node_modules/ts-nats/lib/tcptransport.js
Module not found: Error: Can't resolve 'tls' in 'C:\Source\NATS\TSClient\nats-ts-client-six\node_modules\ts-nats\lib'
I’m not sure if my understanding is entirely correct, but following some Google searches, it seems these are back-end Node.js modules which are not meant for use on browsers. Because of this, I suspect that my attempted usage of ts-nats is completely wrong.
Given the above, if my suspicion is correct, would you kindly point me in the right direction? I just want to set up a web project (preferably using Angular 6) with NATS.
Or if my usage is correct and there is an actual issue here, could you please assist me in resolving these errors?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
This gave me exactly what I was looking for: https://www.npmjs.com/package/websocket-nats
Used with the ws-tcp-relay pre-requisite running alongside the NATS server: https://github.com/isobit/ws-tcp-relay
Closing the issue.
@dalu nats.ws is coming soon.