Debugging Remix server-side 500s

After pushing a change to a Remix app to Pages + Functions, I'm getting 500 errors in the browser, but Cloudflare Pages Functions logs show "successful" requests. How do I get the underlying error?
{
"outcome": "ok",
"scriptName": "pages-worker--1051688-production",
"exceptions": [],
"logs": [
{
"message": [
"Error: Unexpected Server Error"
],
"level": "error",
"timestamp": 1683332030573
}
],
"eventTimestamp": 1683332030459,
"event": {
"request": {
"url": "https://dd33ea81.cf-remix-65c.pages.dev/",
"method": "GET",
"headers": {
...
},
"cf": {
...
}
},
"response": {
"status": 500
}
},
"id": 0
}
{
"outcome": "ok",
"scriptName": "pages-worker--1051688-production",
"exceptions": [],
"logs": [
{
"message": [
"Error: Unexpected Server Error"
],
"level": "error",
"timestamp": 1683332030573
}
],
"eventTimestamp": 1683332030459,
"event": {
"request": {
"url": "https://dd33ea81.cf-remix-65c.pages.dev/",
"method": "GET",
"headers": {
...
},
"cf": {
...
}
},
"response": {
"status": 500
}
},
"id": 0
}
1 Reply
Kris
KrisOP2y ago
The underlying error turned out to be caused by accessing an undefined environment variable in a loader . Not yet sure why there wasn't a better error with stack trace.
Want results from more Discord servers?
Add your server