Skip to content

SSE session example doesn't work #481

@diegolosramos

Description

@diegolosramos

Check existing issues

Describe the bug

The sse session example doesn't work. When I attempt to run it I get this error.

npm run client

> client
> tsx src/client.ts

Client account: 0xfB9249...
Funding account via faucet...
Balance: 1000000 pathUSD

--- Channel ---
Max deposit: 1 pathUSD (locked into payment channel on first request)
Price per token: 0.000075 pathUSD

--- Streaming (prompt: "Tell me something interesting") ---
Thenode:internal/deps/undici/undici:11132
            fetchParams.controller.controller.error(new TypeError("terminated", {
                                                    ^

TypeError: terminated
    at Fetch.onAborted (node:internal/deps/undici/undici:11132:53)
    at Fetch.emit (node:events:518:28)
    at Fetch.terminate (node:internal/deps/undici/undici:10290:14)
    at Object.onError (node:internal/deps/undici/undici:11253:38)
    at Request.onError (node:internal/deps/undici/undici:2094:31)
    at Object.errorRequest (node:internal/deps/undici/undici:1591:17)
    at Socket.<anonymous> (node:internal/deps/undici/undici:6319:16)
    at Socket.emit (node:events:530:35)
    at TCP.<anonymous> (node:net:346:12) {
  [cause]: SocketError: other side closed
      at Socket.<anonymous> (node:internal/deps/undici/undici:6294:28)
      at Socket.emit (node:events:530:35)
      at endReadableNT (node:internal/streams/readable:1698:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
    code: 'UND_ERR_SOCKET',
    socket: {
      localAddress: '::1',
      localPort: 59218,
      remoteAddress: '::1',
      remotePort: 5173,
      remoteFamily: 'IPv6',
      timeout: undefined,
      bytesWritten: 3021,
      bytesRead: 1370
    }
  }
}

Node.js v22.17.0

The only change I made was passing the secretKey to the to the create method.

const mppx = Mppx.create({
	secretKey,
	methods: [
		tempo.session({

Which is missing in the example.

Link to Minimal Reproducible Example

No response

Steps To Reproduce

Pass the missing secret key to the server.ts file.

const mppx = Mppx.create({
	secretKey,
	methods: [
		tempo.session({

To the mppx create method.

run

bun dev

and in a separate terminal

bun client

Package Version

0.6.28

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions