Closed shydow closed 4 weeks ago
Can you indicate what is your exact env? OS, node version, etc
OS: ubuntu 24.04 LTS node version: v22.9.0 browser: chrome
Can you paste all the outputs? "Use proxy for fetch requests" doesn't looks like the cause of the issue.
Also "prod:secret:generate" is storing value to Cloudflare KV, have you logged into Cloudflare through cli and replaced kv id in wrangler with your own kv id? Have you encouter any issue with "dev:secret:generate" or "node:secret:generate"?
output of generate command:
> prod:secret:generate
> node ./src/scripts/generate-secret.cjs prod
SyntaxError: Unexpected token 'P', "Proxy envi"... is not valid JSON
at JSON.parse (<anonymous>)
at generateRSAKeyPair (/home/shydow/workspace/melody-auth/server/src/scripts/generate-secret.cjs:104:37)
the orginal wrangler command output is like:
❯ npx wrangler kv key list --prefix=jwtPublicSecret --binding=KV --local
Proxy environment variables detected. We'll use your proxy for fetch requests.
[]
Looks similar to https://github.com/cloudflare/workers-sdk/issues/4515. In a proxy env, wrangler will output this extra message, which messed the expected output format.
By proxy env, are you using a vpn or something?
Looks similar to cloudflare/workers-sdk#4515. In a proxy env, wrangler will output this extra message, which messed the expected output format.
yes, you are right.
By proxy env, are you using a vpn or something?
I use the proxy by setting the environment variable
export HTTP_PROXY=xxxx
Check if #185 fix your issue
Excellent work. The bug has been successfully resolved.
Problem Analysis:
On line 104 of [melody-auth/server/src/scripts/generate-secret.cjs]:
the command [wrangler kv key list --prefix=sessionSecret --binding=KV ${condition}] is causing an issue when executed in a proxy environment.
The first line of the output indicates that a proxy environment has been detected: "Proxy environment variables detected. We'll use your proxy for fetch requests."