Skip to content

trace.time is undefined in .trace() callback #1213

Open
@el-tumakov

Description

@el-tumakov

What version of Elysia is running?

1.3.1

What platform is your computer?

Darwin 24.4.0 arm64 arm

What steps can reproduce the bug?

new Elysia()
  .trace(({ time, onAfterResponse }) => {
    onAfterResponse(({ onStop }) => {
      onStop(() => {
        console.log('Trace time: ', time); // undefined
      });
    });
  })
  .get('/', () => 'Hello World!')
  .listen(3000);

What is the expected behavior?

time should contain the timestamp when the request started.

What do you see instead?

time is undefined, which makes it unusable for calculating relative durations manually inside trace handlers.

Additional information

No response

Have you try removing the node_modules and bun.lockb and try again yet?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions