Data Proxy: `prisma generate` errors with `Error: Error: ENOENT: no such file or directory, open '/[...]/prisma/schema.prisma'` when using a custom name for the Prisma schema file
See original GitHub issueBug description
Related error https://github.com/prisma/studio/issues/819
PRISMA_CLIENT_ENGINE_TYPE='dataproxy' npx prisma generate --schema=prisma/customename.prisma
errors with
Environment variables loaded from .env
Prisma schema loaded from prisma/customename.prisma
Error:
Error: ENOENT: no such file or directory, open '/Users/[...]/repro/testpdp/prisma/schema.prisma'
The filename of my schema is customename.prisma
How to reproduce
I took the url-shortener example from Prisma Data Platform
- Clone the repo https://github.com/Jolg42/testpdp
- run
npm install
- run
PRISMA_CLIENT_ENGINE_TYPE='dataproxy' npx prisma generate --schema=prisma/customename.prisma
Expected behavior
Passing --schema=prisma/customename.prisma
to provide a filename different than “schema.prisma” should work.
Prisma information
Environment & setup
- OS: Mac OS
- Database: MySQL / PlanetScale
- Node.js version: 16
Prisma Version
Version from the example
prisma : 3.4.2
@prisma/client : 3.4.2
Current platform : darwin
Query Engine (Node-API) : libquery-engine 57771c0558568c7d08bd34c7248af5244ae16bd9 (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine : migration-engine-cli 57771c0558568c7d08bd34c7248af5244ae16bd9 (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core 57771c0558568c7d08bd34c7248af5244ae16bd9 (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt 57771c0558568c7d08bd34c7248af5244ae16bd9 (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : 57771c0558568c7d08bd34c7248af5244ae16bd9
Studio : 0.438.0
also happens with the most recent dev version
prisma : 3.8.0-dev.30
@prisma/client : 3.8.0-dev.30
Current platform : darwin
Query Engine (Node-API) : libquery-engine 32167501df0cbf888e1138c386d569bf3572ac10 (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine : migration-engine-cli 32167501df0cbf888e1138c386d569bf3572ac10 (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core 32167501df0cbf888e1138c386d569bf3572ac10 (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt 32167501df0cbf888e1138c386d569bf3572ac10 (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : 32167501df0cbf888e1138c386d569bf3572ac10
Studio : 0.449.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Generating the client (Concepts) - Prisma
This page explains how to generate Prisma Client. ... Prisma Client is an auto-generated database client that's tailored to your database schema.
Read more >Prisma schema (Reference)
The Prisma schema is the main configuration file when using Prisma. It is typically called schema.prisma and contains your database connection and data...
Read more >Error message reference - Prisma
Prisma Client throws a PrismaClientUnknownRequestError exception if the query engine returns an error related to a request that does not have an error...
Read more >PostgreSQL database connector (Reference) - Prisma
provider : Specifies the postgresql data source connector. url : Specifies the connection URL for the PostgreSQL database server. In this case, an...
Read more >Prisma 3.15.0 Release - GitClear
Schema validation does not accept absolute Windows style paths for SQLite database · introspect --url throws error if existing schema file only ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can reproduce this with the latest
dev
:Repo for reproduction: https://github.com/janpio/prismapdpurlshortener
I am also unable to reproduce this.