HardAtWork
11/25/2022, 10:03 AMrodbs
11/25/2022, 10:19 AMPause
11/25/2022, 8:46 PMrage5quid
11/25/2022, 8:47 PMWalshy | Pages
11/25/2022, 8:49 PMWalshy | Pages
11/25/2022, 8:50 PMrage5quid
11/25/2022, 8:51 PMThanh Nguyen
11/26/2022, 4:44 AMPause
11/26/2022, 5:05 AMPause
11/26/2022, 5:05 AMPause
11/26/2022, 5:07 AMdata
so it can be reused.bkyerv
11/26/2022, 12:59 PMwrangler pages dev --persist --r2=PIC -- npm run dev
) everything seems to work with no errors, however when I deploy the app using cf pages UI of the app works with no errors but any attempt to trigger functions result in errors. On the client (i.e. in the console tab of the devtools section of the browser) I see internal server error 500
, on the backend wrangler pages deployment tail
I see Error: network connection lost
. Initially I built the app using astro/vanillajs but then tried vite/react thinking that the error might be specific to astro, however the error persistsbkyerv
11/26/2022, 1:01 PMbkyerv
11/26/2022, 1:03 PMwrangler pages dev --persist --r2=PIC -- npm run dev
to test locally the app is available on both port 5173(default for vite) and port8788(default for wrangler/workerd?). The one that is available on port 8788 works well while the one available on port 5173 results in same type of errors as the one on the prod (ie [project-name].pages.dev
)aautio
11/26/2022, 1:31 PMawait
from the fetch("/api/upload", ...)
in the first screenshot. Without await
the code execution does not wait for network request to finish before printing out end calling api
. Might be worth trying it out: await fetch("/api/upload", ...)
bkyerv
11/26/2022, 1:36 PM.then
to handle the async part. I will try to replace with await but I feel that whole this error has something to do with deploy. It seems like requests I am making are not directed to functions and therefore return some weird errorszsmooth
11/26/2022, 1:39 PMaautio
11/26/2022, 1:39 PM.then()
, no need to remove it. Just do await fetch("/api/upload", ...).then(...)
to make sure the whole promise chain is resolved before the execution continues to the line printing end calling api
.
But yep this is likely not related to your original issue :/zsmooth
11/26/2022, 1:39 PMzsmooth
11/26/2022, 1:44 PMbkyerv
11/26/2022, 1:46 PMzsmooth
11/26/2022, 1:51 PMbkyerv
11/26/2022, 1:51 PMzsmooth
11/26/2022, 1:52 PMbkyerv
11/26/2022, 1:52 PMbkyerv
11/26/2022, 1:53 PMbkyerv
11/26/2022, 1:53 PMbkyerv
11/26/2022, 1:53 PMbkyerv
11/26/2022, 1:54 PMdist
folderzsmooth
11/26/2022, 2:05 PM