Skip to content

MsgHdrsImpl.toRecord() fails #344

@jacobbogers

Description

@jacobbogers

Observed behavior

I did this in node REPL

var headers = MsgHdrsImpl.fromRecord({ a: 'x', d: 1 });   // works no problem

> headers.toRecord()  // oops
Uncaught TypeError: Spread syntax requires ...iterable[Symbol.iterator] to be a function
    at C:\repos\mailer-service\node_modules\@nats-io\nats-core\lib\headers.js:241:21
    at Array.forEach (<anonymous>)
    at MsgHdrsImpl.values (C:\repos\mailer-service\node_modules\@nats-io\nats-core\lib\headers.js:238:14)     
    at C:\repos\mailer-service\node_modules\@nats-io\nats-core\lib\headers.js:261:28
    at Array.forEach (<anonymous>)
    at MsgHdrsImpl.toRecord (C:\repos\mailer-service\node_modules\@nats-io\nats-core\lib\headers.js:260:21)

Expected behavior

should give back the object { a: 'x', d: 1 } as used in example

Server and client version

nats server 2.11

"@nats-io/jetstream": "3.2.0",

Host environment

windows 11

Steps to reproduce

I entered the command in node REPL (see above)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions