Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defer/<TypedAwait> - Date Type not converted back to Date #36

Open
piotrkulpinski opened this issue Nov 16, 2023 · 4 comments
Open

defer/<TypedAwait> - Date Type not converted back to Date #36

piotrkulpinski opened this issue Nov 16, 2023 · 4 comments

Comments

@piotrkulpinski
Copy link

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 a string. This causes a lot of issues.

CleanShot 2023-11-16 at 09 08 39

You can find the basic example here:
https://stackblitz.com/edit/remix-run-remix-v11hmg?file=app%2Froutes%2F_index.tsx

@abustany
Copy link

Same issue here, running Remix 2.3.1

@abustany
Copy link

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.

@jagodin
Copy link

jagodin commented Dec 30, 2023

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:

typeddefer.mp4

@hunkydoris
Copy link

hunkydoris commented Feb 7, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants