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
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.
I know the reason, but I can't solve it. The request sent by my local fetch needs to access the proxy
Do you know how wrangler configures proxy on Windows?thank you
You do the same and configure environment variables. Though not sure if that works for fetch requests
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
For windows you would do
set HTTP_PROXY=
Thank you for your help.I added environment variables, but the wrangler doesn't work properly
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
Yes, it is not used for fetch requests
Then your best bet is probably remote dev instead of local.
😭😭😭Ok,thank you for your reply