P
Prisma•2w ago
Adde

Migrationg to 7.0.0

We migrated to v7 from 6.19.0 and now we just get a TON of errors
Module '"@prisma/client"' has no exported member 'FileType'.ts(2305)
Module '"@prisma/client"' has no exported member 'FileType'.ts(2305)
for ALL files
12 Replies
Prisma AI Help
Prisma AI Help•2w ago
You opted for speed from this bot. Let's conjure up an answer right now! When migrating to Prisma v7, you may encounter errors like Module '"@prisma/client"' has no exported member 'FileType'.ts(2305) for all files. This is a common issue when upgrading major versions, especially if you use a custom output path for the Prisma Client or if your import paths are not updated to match the new structure. Key points from the knowledge sources: - Custom Output Path:
Starting with Prisma v6.6.0, if you specify a custom output path for the Prisma Client in your schema.prisma, you must import types and the client from that custom path, not from @prisma/client. For example, if your generator block is:
generator client {
provider = "prisma-client-js"
output = "../generated/prisma"
}

generator client {
provider = "prisma-client-js"
output = "../generated/prisma"
}

Then you should import like this:
import { PrismaClient, FileType } from '../generated/prisma';

import { PrismaClient, FileType } from '../generated/prisma';

Importing from @prisma/client will not work if you use a custom output path, as the types and client are not generated there anymore. This is a breaking change and is documented in the migration guides and issues see example. - Default Output Path:
If you do not specify a custom output, you should continue to import from @prisma/client. If you see missing exports, ensure you have run prisma generate after upgrading, and that your IDE/TypeScript server is restarted to pick up the new types. - Monorepo/Package Manager Issues:
If you use pnpm or a monorepo, ensure your generated client is accessible to all packages that need it, and consider using a postinstall script:
"scripts": {
"postinstall": "prisma generate"
}

"scripts": {
"postinstall": "prisma generate"
}

This ensures the client is always generated after install, which can resolve many type errors see example. Summary:
Update your import paths to match your Prisma Client output location. If you use a custom output, import from that path. If n ot, ensure you have generated the client and are importing from @prisma/client. Restart your IDE/TS server after changes. If you still have issues, double-check your schema.prisma generator block and your import statements.
Adde
AddeOP•2w ago
generator client { provider = "prisma-client" output = "../node_modules/.prisma/client" } datasource db { provider = "mysql" } enum OrganizationType { COMPANY INDIVIDUAL }
Prisma AI Help
Prisma AI Help•2w ago
🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Nurul
Nurul•2w ago
Could you try changing your output path to somewhere outside the node_modules and changeyour imports to the new path and check?
<@235148962103951360>
We are also getting this issue. all the models are getting deleted and all the enums. it doesnt seem to be working when models are defined in seperate files having the models defined in schema.prisma rather than seperate files seems to work in v7, but this is ugly with a large number of models it appears that schema in prisma.config.ts needs to be set on the folder itself, rather than schema.prisma. this is different behavior in prisma 7. after changing that it works. @Adde maybe you could try this because i also had that issue
Adde
AddeOP•2w ago
Got it to work but now, do we need to reexport ALL types? As we can no longer use @prisma/client in client only files, only for types right @Nurul
Adde
AddeOP•2w ago
Generators (Reference) | Prisma Documentation
Generators in your Prisma schema specify what assets are generated when the prisma generate command is invoked. This page explains how to configure generators.
Mike Hartington
Mike Hartington•2w ago
chiming in, you should be using the generated client for this not the @prisma/client package itself
Domica
Domica•2w ago
Where was that mentioned in the upgrade guide? That using @prisma/client is now deprecated. https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7 Adding in, it seems to be generating .ts files, but looking for .js files in client.ts client.ts
import * as runtime from "@prisma/client/runtime/client"
import * as $Enums from "./enums.js"
import * as $Class from "./internal/class.js"
import * as Prisma from "./internal/prismaNamespace.js"

export * as $Enums from './enums.js'
export * from "./enums.js"
/**
import * as runtime from "@prisma/client/runtime/client"
import * as $Enums from "./enums.js"
import * as $Class from "./internal/class.js"
import * as Prisma from "./internal/prismaNamespace.js"

export * as $Enums from './enums.js'
export * from "./enums.js"
/**
logs
./generated/prisma/client/client.ts
Module not found: Can't resolve './internal/class.js'
./generated/prisma/client/client.ts
Module not found: Can't resolve './enums.js'
./generated/prisma/client/client.ts
Module not found: Can't resolve './internal/prismaNamespace.js'
./generated/prisma/client/client.ts
Module not found: Can't resolve './internal/class.js'
./generated/prisma/client/client.ts
Module not found: Can't resolve './enums.js'
./generated/prisma/client/client.ts
Module not found: Can't resolve './internal/prismaNamespace.js'
Changing them manually to .ts in client.ts and it seems tow rok
Adde
AddeOP•7d ago
Did you figure it out? I have a tone of problem with migrating, I feel the upgrade guide are absolutley trash( Sorry) also NextJS doesnt like "type": "module", "The issue is that at runtime, Node.js is still trying to load from node_modules/.pnpm/@prisma/client/default.js, which expects .prisma/client/default to exist." Collecting page data .[Error: Cannot find module '.prisma/client/default' @Nurul any idea? @Nurul (Prisma) ? 🙂
gastronormie
gastronormie•5d ago
Going through it right now Prisma just infers the output type based on the weather and the time, so set the output type explicitly:
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
generatedFileExtension = "ts"
importFileExtension = "ts"
}
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
generatedFileExtension = "ts"
importFileExtension = "ts"
}
Gregersen
Gregersen•5d ago
It's been mentioned for over a year. The whole roadmap for 2025, was to move gradually away from the rust based client (@prisma/client), instead favoring the TS native version, from the generated folder. Also, why would you specify .js files? In your build step, the generation should also convert the generated (.ts) files, to .js, so that they can be used at runtime. I have not yet come across the need to do these:
generatedFileExtension = "ts"
importFileExtension = "ts"
generatedFileExtension = "ts"
importFileExtension = "ts"
So I suspect you may be doing something a bit unusual. Maybe this reproduction (Prisma in a monorepo, with NextJS) is helpful to you? https://github.com/aarhusgregersen/prisma-seed-minimal-reproduction/tree/feat/prisma-7 That is likely because you have @prisma/client imports across your codebase still, is it not? These should be converted to point to your generated output folder instead. The @prisma/client is effectively deprecated, when it comes to importing it within your codebase. You do still need it in dependencies for now

Did you find this page helpful?