Description
See #11513
The idea here is that we probably only didn't want to allow undefined
previously because it's stripped from JSON.stringify
. So we added our own error - which we then also added to defer
for consistency (no resolving a defer promise with undefined).
With single fetch - turbo-stream can stream undefined without issue and can handle resolving promises with undefined. Folks have also specifically filed bugs that resolving with undefined crashes/hangs because we no longer have a defer
place to detect and throw.
So it seems simpler overall to just let them return whatever they want/ resolve with whatever they want, and stream it down untouched.
This should be done in Remix v2 behind the future flag (removing the error from loaders/actions) and then copied into v7