QuestionHi everyone, I'm trying to embed Prisma Studio into my Next.js application by following the official guide: However, I encountered a module resolution error in my route.ts: TypeScript Here is my environment and package.json dependencies: JSON Any help or workarounds would be greatly appreciated. Thanks!
prisma : 7.8.0 |
Replies: 1 comment 1 reply
|
The export is real, but it only ships on the preview/dev build of You have No The embed-studio guide is written against the dev channel, where the subpath does exist: // @prisma/studio-core@dev -> exports includes:
"./data/ppg": { "import": { "types": "./dist/data/ppg/index.d.ts", "default": "./dist/data/ppg/index.js" }, ... },
"./data/accelerate": { ... }and FixInstall the dev/preview build instead of the stable one: npm install @prisma/studio-core@devThat pulls a npm install @prisma/studio-core@dev
node --input-type=module -e "import { createPrismaPostgresHttpClient } from '@prisma/studio-core/data/ppg'; console.log(typeof createPrismaPostgresHttpClient)"
# -> functionA couple of things worth knowing so you don't get surprised later:
So nothing is wrong with your config — the guide just targets the preview build and |
The export is real, but it only ships on the preview/dev build of
@prisma/studio-core, not on the stablelatestyou installed.You have
"@prisma/studio-core": "^0.31.1", which resolves to0.31.1(the currentlatestdist-tag). I checked itspackage.jsonexportsand./data/ppgsimply isn't there — the only./data/*subpaths published on stable are:No
./data/ppgand no./data/accelerate, so TypeScript/Node can't resolve@prisma/studio-core/data/ppgandcreatePrismaPostgresHttpClientis unreachable. That's exactly th…