question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Bug 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

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:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Jun 1, 2022

I can reproduce this with the latest dev:

# I had set the dataproxy env var stuff for the system already as I am on Windows where it is not as easy to to for just this command
PS C:\Users\Jan\Documents\throwaway\prismapdpurlshortener> $env:PRISMA_CLIENT_ENGINE_TYPE="dataproxy"

PS C:\Users\Jan\Documents\throwaway\prismapdpurlshortener> npx prisma -v
Environment variables loaded from .env
prisma                  : 3.15.0-dev.35
@prisma/client          : 3.15.0-dev.35
Current platform        : windows
Query Engine (Node-API) : libquery-engine 1c05d2fd02981d04d5367319e82f44e1c44ec0b7 (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine        : migration-engine-cli 1c05d2fd02981d04d5367319e82f44e1c44ec0b7 (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine    : introspection-core 1c05d2fd02981d04d5367319e82f44e1c44ec0b7 (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary           : prisma-fmt 1c05d2fd02981d04d5367319e82f44e1c44ec0b7 (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash    : 1c05d2fd02981d04d5367319e82f44e1c44ec0b7
Studio                  : 0.460.0
PS C:\Users\Jan\Documents\throwaway\prismapdpurlshortener> npx prisma generate --schema .\prisma\customname.prisma
Environment variables loaded from .env
Prisma schema loaded from prisma\customname.prisma
warn Preview feature "dataProxy" is deprecated. The functionality can be used without specifying it as a preview feature.
Error: 
Error: ENOENT: no such file or directory, open 'C:\Users\Jan\Documents\throwaway\prismapdpurlshortener\prisma\schema.prisma'  

Repo for reproduction: https://github.com/janpio/prismapdpurlshortener

1reaction
pantharshit00commented, Jun 1, 2022

I am also unable to reproduce this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found