Skip to content

postgres date field in JSONB serialization regression in 7.4.0 #29174

@alexmalev

Description

@alexmalev

Bug description

in version 7.2.0 and before, given a schema of:

model ModelWithJson {
  id String @id
  properties Json
}

using:

await this.prisma.modelWithJson.create({
      data: {
        id: '1',
        properties: {
          dateField: new Date(),
        },
      },
    });

would produce a properties field with an iso string:

{"dateField": "2026-02-12T13:32:20.594Z"}

but now we get:

{"dateField": {"$type": "DateTime", "value": "2026-02-12T13:32:20.594Z"}}

which is a corruption of the json of course

Severity

🚨 Critical: Data loss, app crash, security issue

Reproduction

Expected vs. Actual Behavior

expected json field:

{"dateField": "2026-02-12T13:32:20.594Z"}

actual json field:

{"dateField": {"$type": "DateTime", "value": "2026-02-12T13:32:20.594Z"}}

Frequency

Consistently reproducible

Does this occur in development or production?

Both development and production

Is this a regression?

Yes, last worked in Prisma 7.2.0, broke in 7.4.0

Workaround

downgrading fixes it

Prisma Schema & Queries

model ModelWithJson {
  id String @id
  properties Json
}
await this.prisma.modelWithJson.create({
      data: {
        id: '1',
        properties: {
          dateField: new Date(),
        },
      },
    });

Prisma Config

// Add your `prisma.config.ts`

Logs & Debug Info

// Debug logs here

Environment & Setup

  • OS: macOS
  • Database: PostgreSQL
  • Node.js version: v24.12.0

Prisma Version

7.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions