Skip to content

馃檹 [NEXTJS] Unable to use RUM without error#3068

Description

@paul-roman

What are you trying to achieve and what is your issue? Please describe.
I used the official doc to install RUM on my Next.js application, and it's working like a charm on a dev environment.
However, whenever the code goes to staging/production I run into an error: datadogRum.init seems to be working just fine, as well as setUser, however when I turn debug on using ._setDebug(true), I get an error whenever I load a page or whenever I try to .startView manually:
Image

This error seems to come from this line in the RUM source code (browser-sdk/packages/core/src/domain/session/sessionManager.ts) :

function buildSessionContext() {
    return {
      id: sessionStore.getSession().id!, // <------ HERE
      trackingType: sessionStore.getSession()[productKey] as TrackingType,
      isReplayForced: !!sessionStore.getSession().forcedReplay,
    }
  }

I use the 5.28.0 version.
Does anyone has any clue about this? 馃檹

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