Skip to content

_next/data paths returning HTML for server-side props when used with OpenNext #1041

@petlab-alex

Description

@petlab-alex

Hi,

We're experiencing an issue where all _next/data JSON paths return HTML for requests from getServerSideProps. This breaks our state management workflow with zustand, as when the next page is shown it is unable to request the data from the store. I was able to instrument the application with OpenTelemetry, and it seems to be going right from getServerSideProps to render route (pages):

{
  "default": {
    "next.route": "/[checkoutId]/billing",
    "next.span_name": "resolve page components",
    "next.span_type": "NextNodeServer.findPageComponents"
  }
}

{
  "default": {
    "next.route": "/[checkoutId]/billing",
    "next.span_name": "getServerSideProps /[checkoutId]/billing",
    "next.span_type": "Render.getServerSideProps"
  }
}

{
  "default": {
    "next.route": "/[checkoutId]/billing",
    "next.span_name": "render route (pages) /[checkoutId]/billing",
    "next.span_type": "Render.renderDocument"
  }
}

Our app is deployed on AWS via SSTv3. The same deployment directly via Amplify works without issues. Currently, this is blocking our migration to OpenNext/SST.

OpenNext version: 3.6.6
Next.js version: 15.5.2
SST version: 3.17.14

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