You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I imagine what we'll probably do is try to return Response.json(...) with the stuff you passed to data() and if that errors and is unable to serialize then we'll log a human readable error
That way return data({ legit: 'json' }, init) works and folks can share utility functions across resource and non-resource routes with JSON as the serialization layer. If you want to return something other than JSON you will need to return your own response
We can probably also check if it's just a string and send a text/plain response too
Actual Behavior
Returns this error (note, this is only for throw data, not return data)
{
"message": "Unexpected Server Error",
"stack": "Error: Unexpected Server Error\n at errorResponseToJson (/home/projects/remix-run-remix-b2ekrr/node_modules/@remix-run/server-runtime/dist/server.js:438:26)\n at handleResourceRequest (/home/projects/remix-run-remix-b2ekrr/node_modules/@remix-run/server-runtime/dist/server.js:429:14)\n at async requestHandler (/home/projects/remix-run-remix-b2ekrr/node_modules/@remix-run/server-runtime/dist/server.js:156:18)\n at async nodeHandler (/home/projects/remix-run-remix-b2ekrr/node_modules/@remix-run/dev/dist/vite/plugin.js:839:27)\n at async eval (/home/projects/remix-run-remix-b2ekrr/node_modules/@remix-run/dev/dist/vite/plugin.js:842:15)"
}
The text was updated successfully, but these errors were encountered:
Reproduction
StackBlitz
System Info
Used Package Manager
npm
Expected Behavior
From the @brophdawg11 himself:
Actual Behavior
Returns this error (note, this is only for
throw data
, notreturn data
)The text was updated successfully, but these errors were encountered: