pages functions The server running locally is abnormal 500

I started pages functions locally through wrangler, which sends an http request and returns 500 to the local server when it runs, but it worked when I deployed it to a remote server. Does anyone know why? Local access function can not access the Internet, just like kv local operation can only access local kv,right?
11 Replies
Cyb3r-Jak3
Cyb3r-Jak312mo ago
Not really able to tell without seeing the code. Best guess is you are making a request to something which doesn’t respond correctly in local mode but does when deployed.
arlettebrook
arlettebrookOP12mo ago
I know the reason, but I can't solve it. The request sent by my local fetch needs to access the proxy
arlettebrook
arlettebrookOP12mo ago
Do you know how wrangler configures proxy on Windows?thank you
No description
Cyb3r-Jak3
Cyb3r-Jak312mo ago
You do the same and configure environment variables. Though not sure if that works for fetch requests
arlettebrook
arlettebrookOP12mo ago
On Windows, the official documentation does not provide proxy configuration instructions, and the above environment variable wrangler cannot be recognized normally. If I configure the proxy of fetch request separately, it will be troublesome
Cyb3r-Jak3
Cyb3r-Jak312mo ago
For windows you would do set HTTP_PROXY=
arlettebrook
arlettebrookOP12mo ago
Thank you for your help.I added environment variables, but the wrangler doesn't work properly
No description
No description
arlettebrook
arlettebrookOP12mo ago
When I modify it to https_ proxy, able to start, but response: [angler] Could not proxy request: TypeError: fetch failed.I'm not sure what kind of service the wrangler proxy is, so I'm considering giving it up
No description
No description
arlettebrook
arlettebrookOP12mo ago
Yes, it is not used for fetch requests
No description
Cyb3r-Jak3
Cyb3r-Jak312mo ago
Then your best bet is probably remote dev instead of local.
arlettebrook
arlettebrookOP12mo ago
😭😭😭Ok,thank you for your reply
Want results from more Discord servers?
Add your server