edgedb / edgedb-js

The official TypeScript/JS client library and query builder for EdgeDB
https://edgedb.com
Apache License 2.0
510 stars 65 forks source link

Auth-core throws weird errors when used with edgedb deploys on my own server #1060

Open Huliiiiii opened 2 months ago

Huliiiiii commented 2 months ago

Describe the bug A clear and concise description of what the bug is.

Authentication failed: InvalidDataError: Missing query parameter: code
    at decodeError (D:\...\node_modules\@edgedb\auth-core\dist\utils.js:117:16)
    at requestGET (D:\...\node_modules\@edgedb\auth-core\dist\utils.js:47:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GET (D:/.../node_modules/edge-auth-solid-start/src/server/index.ts:293:27)    
    at async eval (D:/.../node_modules/@solidjs/start/dist/server/handler.js:38:23)        
    at async _callHandler (file:///D:/.../node_modules/h3/dist/index.mjs:1821:16)
    at async _callHandler (file:///D:/.../node_modules/h3/dist/index.mjs:1821:16)
    at async file:///D:/.../node_modules/h3/dist/index.mjs:1962:19
    at async Object.callAsync (file:///D:/.../node_modules/unctx/dist/index.mjs:72:16)     
    at async Server.toNodeHandle (file:///D:/.../node_modules/h3/dist/index.mjs:2249:7) 

QQ_1721620240738

QQ_1721620213733 Reproduction Include the code that is causing the error:

// code here

Expected behavior A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

Additional context Add any other context about the problem here.

scotttrinh commented 2 months ago

Hmmm, I can't think of what might be going on here based on the code you've provided in your screenshot. Do you mind linking to more of the code, and any details about the runtime (node, deno, bun, something else?)? Maybe there is a weird binding issue with this.core, or maybe some strange runtime garbage collection issue where the valid is present at call time, but somehow isn't getting closed over correctly? This seems far fetched, but not entirely impossible.

Huliiiiii commented 2 months ago

node version: v20.15.0

It happened here:

https://github.com/Huliiiiii/edgedb-js/blob/438101f371c09d9f22a281b636882dd4d9cf6568/packages/auth-solid-start/src/server/index.ts#L417-L424