Open piotrkulpinski opened 9 months ago
Same issue here, running Remix 2.3.1
OK I found the issue in my case: the Promise was nested inside the loader data. Looking at the code, it seems that typeddefer
only looks at top level properties.
I'm also running into this issue. Following the example in the README, it seems as though the data gets properly serialized by typeddefer
but fails to properly deserialize somewhere in <TypedAwait />
.
I can also see that when navigating back to the deferred route, the previously resolved data is correctly deserialized for a brief moment before the loader runs again. Notice the flicker of typeof slowData.tomorrow is object
in the video:
https://github.com/kiliman/remix-typedjson/assets/17988743/842728c8-0427-4fd7-aa6b-3380fed681d4
@kiliman , if you have time, could you please take a look at it? I'm using the latest Remix (2.6.0), and this issue still persists. As @abustany mentioned earlier, it causes an issue when a date is nested inside an array. Also when we refresh the browser.
Hi,
I'm using the typeddefer function of the package and run into some bug where Date objects are not converted back to Date after using
<TypedAwait />
.The VS Code says it's of type
Date
when in reality it's astring
. This causes a lot of issues.You can find the basic example here: https://stackblitz.com/edit/remix-run-remix-v11hmg?file=app%2Froutes%2F_index.tsx