Replies: 1 comment
-
|
Ok so after trying to work around this in the meantime by doing a I've tried to replace that in my example with a custom class with a That produces a huge number of React hydration errors and then Remix throws a timeout error even though its successfully rendered the initial page; I assume this is because when rendering server-side I'm happy to accept part of this is because I've just assumed too much about e.g. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have effectively the following:
Because determining the count of hours for a report can take more than a few seconds, I figured I would show a bit of UI so people knew the app was actually loading - based on the docs I expected I could just safely replace
jsonwithdefer:Except it seems there is a difference when the initial server-side render is done: with
jsonthe data is always serialized soreport.createdAtis an ISO string both server and client side, but withdeferit remains an instance ofDateserver side and thus Luxon explodes due to expecting an ISO string to parse.I feel like this is probably a bug but wouldn't be surprised if it's not via "we can't always assume this should be JSON, that's the point of the
jsonhelper, etc"; if it isn't a bug then I think this should be made clear in the documentation along with how to properly handle this - currently it seems that maybe I need to manually doJSON.stringify+JSON.parsewhich seems pretty annoying...What's scarier (and is a bug if there isn't a bug in
defer) is that the types don't convey this - TypeScript always expects that the data has been serialized regardless of usingdeferorjson.Beta Was this translation helpful? Give feedback.
All reactions