-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Labels
defectSuspected defect such as a bug or regressionSuspected defect such as a bug or regression
Description
Observed behavior
I installed nats via npm i nats but whenever I run my app, I get the following error
./node_modules/nats/lib/src/mod.js Module not found: Can't resolve 'stream/web' in '/Users/desktop/myapp/node_modules/nats/lib/src'
Expected behavior
private readonly codec = StringCodec();
send = async <TOut, Tin>(subject: string, payload: Tin): Promise<TOut> => {
const connection: NatsConnection = await connect(this.brokerOptions);
const result = await connection.request(subject, JSON.stringify(payload), { timeout: 1000 })
.then((m) => this.codec.decode(m.data))
.then((data) => <TOut>JSON.parse(data));
connection.close();
return result;
};
Server and client version
nats version: "2.21.0"
node version: 16.17.1
npm version: 8.15.0
Host environment
No response
Steps to reproduce
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
defectSuspected defect such as a bug or regressionSuspected defect such as a bug or regression