`InvalidDatasourceError` of Data Proxy Client outputs a code snippet
See original GitHub issueC:\Users\Jan\Documents\throwaway\dataProxyTest>node script.js
C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:27
`)}`});let i={batch:e.map(o=>({query:o,variables:{}})),transaction:r},{batchResult:a}=await this.requestInternal(i,t,n);return a}async requestInternal(e,t,r){var n;await this.pushPromise;try{this.logEmitter.emit("info",{message:`Calling ${this.url("graphql")} (n=${r})`});let i=await Sr(this.url("graphql"),{method:"POST",headers:{...t,...this.headers},body:JSON.stringify(e)}),a=await Kr(i,this.clientVersion);if(a instanceof Yr)throw await this.uploadSchema(),new Wr({clientVersion:this.clientVersion,c
InvalidDatasourceError: Datasource URL should use prisma:// protocol. If you are not using the Data Proxy, remove the `dataProxy` from the `previewFeatures` in your schema and ensure that `PRISMA_CLIENT_ENGINE_TYPE` environment variable is not set to `dataproxy`. at Object.extractHostAndApiKey (C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:27:1513) at new DataProxyEngine (C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:25:14740) at t.getEngine (C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:104:3039) at new PrismaClient (C:\Users\Jan\Documents\throwaway\dataProxyTest\node_modules\@prisma\client\runtime\proxy.js:104:2583) at file:///C:/Users/Jan/Documents/throwaway/dataProxyTest/script.js:2:16 at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
at async Loader.import (node:internal/modules/esm/loader:178:24)
at async Object.loadESM (node:internal/process/esm_loader:68:5)
at async handleMainPromise (node:internal/modules/run_main:63:12) {
clientVersion: '3.14.0',
cause: undefined,
isRetryable: false,
code: 'P5002'
}
This error output is unexpected.
Reproduction
- Create new folder with Prisma project via
npx prisma init
- Modify schema:
generator client { provider = "prisma-client-js" previewFeatures = ["dataProxy"] } datasource db { provider = "postgresql" url = env("DATABASE_URL") } model foo { id Int @id }
- Generate Data Proxy Client: https://www.prisma.io/docs/concepts/data-platform/data-proxy#step-3-enable-the-feature-flag-in-the-prisma-schema-file and following
- Minimal
scripts.js
:import { PrismaClient } from '@prisma/client' const prisma = new PrismaClient()
- Add
"type": "module"
topackage.json
node script.js
- Observe error
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Prisma 3.15.0 Release - GitClear
In this release, we're shipping a couple of improvements to Prisma Client for Data Proxy. The Prisma Data Proxy provides connection management ...
Read more >InvalidDatasourceError: Datasource URL should use prisma ...
So I am using Prisma as an ORM on my project to communicate with the database that I set up with AWS. Not...
Read more >Prisma on Twitter: " Using the Prisma Client and leveraging ...
Workers! Check out this neat code snippet on how it looks like to use Prisma Client inside of this environment More info here: ......
Read more >Setting Up HTTP Proxies - CircleCI
Learn how to configure CircleCI server to use an HTTP proxy. ... SSH into the Services machine and run the following code snippet...
Read more >@prisma/generator-helper: Versions | Openbase
prisma migrate dev previously returned a successful exit code (0) when prisma db seed ... InvalidDatasourceError of Data Proxy Client outputs a code...
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
Now I can confirm this is fixed with 3.15.0:
Sorry, let me correct myself, I meant that I cannot reproduce this with the latest changes in the
chore/data-proxy-ga-3
branch.