Skip to content

NextJS after - Compatibility with vercel/otel? #138

@websaid

Description

@websaid

SUMMARY

NextJS 15.1 made the after function stable: https://nextjs.org/docs/app/api-reference/functions/after

I tried the following code in my page.tsx:

  after(() => {
    trace.getActiveSpan()?.addEvent("Page streaming finished")
  });

I get the following error Can not execute the operation on ended Span.

My wondering: Could it be that @vercel/otel is ending the span before potentially running the after function?

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