question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

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:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
FSteynberg01commented, Oct 15, 2018

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.

1reaction
aricartcommented, Jan 27, 2020

@dalu nats.ws is coming soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NATS & Angular 6 · Issue #23 · nats-io/nats.ts - GitHub
Hi, I've been attempting to get ts-nats working in a new Angular 6 project in order to set up a PoC for playing...
Read more >
node.js - Using nats with angular to discuss with Hemerajs ...
Indeed I am writing an Hemerajs (Hemerajs) server application couple with a NATS (NATS) messaging server. Moreover I'd like to plug an Angular...
Read more >
nats.ws - npm
WebSocket NATS client. Latest version: 1.10.2, last published: 12 days ago. Start using nats.ws in your project by running `npm i nats.ws`.
Read more >
WebSocket and NATS | Hello World - YouTube
Join Synadia Engineer, Alberto Ricart, in this introductory demo of NATS and WebSocketNATS WebSocket repo https://github.com/ nats -io/ nats.
Read more >
NATS Messaging - ThinkMicroservices.com
JetStream replaces the NATS Streaming server, which is sunsetting in June 2023. It extends NATS to include message store and replay by time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found