Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated types are any #436

Open
2 tasks done
Mnigos opened this issue Jan 28, 2025 · 0 comments
Open
2 tasks done

Generated types are any #436

Mnigos opened this issue Jan 28, 2025 · 0 comments

Comments

@Mnigos
Copy link

Mnigos commented Jan 28, 2025

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Versions

    "prisma": "^6.2.1",
    "prisma-json-types-generator": "^3.2.2",
    "@prisma/client": "6.2.1",
    "@prisma/extension-accelerate": "^1.2.1",

I also tried it without @prisma/extension-accelerate, but same result.

A minimal reproducible example

https://github.com/Mnigos/prisma-json-issue-reproduction

Description

Generated types are not resolved correctly.

prisma-json.ts

declare global {
  namespace PrismaJson {
    interface Coordinates {
      x: number;
      y: number;
      z: number;
    }
  }
}

lib/prisma.ts

import "../prisma-json";

import { PrismaClient } from "@prisma/client";
import { withAccelerate } from "@prisma/extension-accelerate";

const prisma = new PrismaClient().$extends(withAccelerate());

const globalForPrisma = global as unknown as { prisma: typeof prisma };

if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;

export { prisma };
Image

Steps to Reproduce

Just open reproduction repository, install dependencies and generate prisma types.

Expected Behavior

Should not be any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant