Issue Description
Connecting to a remote Deno Kv database deployed on Deno Deploy Classic works fine,
But connecting to one deployed on Deno Deploy EA doesn't!,
Instead, it responds with "The authorization token is not valid" error (though I just created the access token, copied and set it correctly)
Am i missing something 🤔?
The versions I used:
- Deno v2.5.1
@deno/kv@0.10.0 package
Reproduce the error
You need to provision a Deno Kv database in Deno Deploy EA and bring a personal access token
In Deno runtime
Deno.env.set("DENO_KV_ACCESS_TOKEN", "ddp_...")
const kv = await Deno.openKv("https://api.deno.com/databases/<DB_ID>/connect")
console.log(await kv.get(["any-random-key"]))
In Node runtime + @deno/kv package
import { openKv } from "@deno/kv";
Deno.env.set("DENO_KV_ACCESS_TOKEN", "ddp_...")
const kv = await openKv("https://api.deno.com/databases/<DB_ID>/connect")
console.log(await kv.get(["any-random-key"]))
Run
deno run -A --unstable-kv test.ts
You should now see something like this:
error: Uncaught (in promise) Error: Failed to fetch metadata: {
"code": "invalidToken",
"message": "The authorization token is not valid: The bearer token is invalid."
}
console.log(await kv.get(["any-random-key"]))
The error seems coming from kv.get method
Issue Description
Connecting to a remote Deno Kv database deployed on Deno Deploy Classic works fine,
But connecting to one deployed on Deno Deploy EA doesn't!,
Instead, it responds with "The authorization token is not valid" error (though I just created the access token, copied and set it correctly)
Am i missing something 🤔?
The versions I used:
@deno/kv@0.10.0packageReproduce the error
You need to provision a Deno Kv database in Deno Deploy EA and bring a personal access token
In Deno runtime
In Node runtime +
@deno/kvpackageRun
You should now see something like this:
The error seems coming from
kv.getmethod