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

Single Fetch: bad behavior in promises that resolve to undefined and null #9325

Closed
gustavopch opened this issue Apr 26, 2024 · 3 comments
Closed

Comments

@gustavopch
Copy link
Contributor

Reproduction

https://stackblitz.com/edit/remix-run-remix-wfeots?file=app%2Froutes%2F_index.tsx

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @remix-run/dev: * => 2.9.1 
    @remix-run/node: * => 2.9.1 
    @remix-run/react: * => 2.9.1 
    @remix-run/serve: * => 2.9.1 
    vite: ^5.1.0 => 5.2.10

Used Package Manager

npm

Expected Behavior

  • Returning a promise that resolves to null from the loader shouldn't crash when resolved on the client.
  • Returning a promise that resolves to undefined from the loader shouldn't hang on the client.

Actual Behavior

  • It crashes.
  • It hangs.
@jacob-ebey
Copy link
Member

jacob-ebey commented Apr 29, 2024

Null should be safe if you upgrade turbo-stream in your project to the latest version. Undefined is an issue with the <Await> component and will be fixed in a react-router release. Thank you for the report and reproduction.

@brophdawg11
Copy link
Contributor

This should be available in the next release

@brophdawg11 brophdawg11 added the awaiting release This issue has been fixed and will be released soon label Apr 30, 2024
@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label May 10, 2024
@brophdawg11
Copy link
Contributor

2.9.2 is released - https://github.com/remix-run/remix/releases/tag/remix%402.9.2

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

No branches or pull requests

3 participants