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

useAsync inside dynamically imported components doesn't work as intended on first run #233

Open
b3nten opened this issue Jan 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@b3nten
Copy link
Collaborator

b3nten commented Jan 1, 2023

useAsync calls inside of dynamically imported components push the callback into the dataStream context after the stream has finished. This means that they don't stream to the client. This only occurs the first time the server renders a page. Subsequent requests work as intended.

Here is a github repo that demonstrates this.
https://github.com/B3nten/useAsync-repro

I currently have no idea why it works okay on subsequent requests, but as it does so I think it should be possible to fix.

@b3nten
Copy link
Collaborator Author

b3nten commented Jan 5, 2023

Reproduction:
https://github.com/B3nten/ultra/tree/async-debug

Steps:

  1. Run deno task dev, chose 18 (with-react-router).
  2. Note console output on full refresh of pages Home and About
  3. Note difference in output on subsequent refreshes of About
  1. ./about.html and ./ABOUT2.html are the returned responses from /about, on first request and second.

@mashaal mashaal added the bug Something isn't working label May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants