Doc pointing to the wrong import path for Prisma Client #6794
Labels
docs
Documentation creation, updates or corrections
priority: high
Defines a high priority issue that we want to tackle right away
Bug description
Hello,
I was following this Prisma get started doc , and I've notice a thing here.
Although it says that I have to import with
require('@prisma/client')
, this results in the following error.This is because, in the docs, it says that I should run the following command.
npx prisma init --datasource-provider postgresql --output ../generated/prisma
If i do this, it generates the module into
../generated/prisma
instead ofnode_modules/@prisma/client/default.js
In fact, it correctly imports by importing with
const { PrismaClient } = require("./generated/prisma/default");
.I think there should be an explanation with this in the docs.
Thanks for the consideration.
Expected vs. Actual Behavior
Expected not to throw
module not found
error.Frequency
Consistently reproducible
Does this occur in development or production?
Only in development (e.g., CLI tools, migrations, Prisma Studio)
Is this a regression?
Workaround
Prisma Schema & Queries
// Add relevant schema.prisma snippet
// Add relevant Prisma Client query
Logs & Debug Info
Environment & Setup
Prisma Version
The text was updated successfully, but these errors were encountered: