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

V2_MetaFunction type incorrect for error boundaries #5786

Closed
1 task done
kentcdodds opened this issue Mar 14, 2023 · 2 comments
Closed
1 task done

V2_MetaFunction type incorrect for error boundaries #5786

kentcdodds opened this issue Mar 14, 2023 · 2 comments
Labels
bug Something isn't working feat:links-meta Issues related to links()/meta() feat:typescript v2 Issues related to v2 apis

Comments

@kentcdodds
Copy link
Member

kentcdodds commented Mar 14, 2023

What version of Remix are you using?

1.14.1

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  1. Configure remix for the latest meta and error boundary features
  2. Make a route that throws an error or response in the loader
  3. Add a meta export that uses the V2_MetaFunction generic and pass <typeof loader>
  4. Use data.whatever and see that the types are totally cool with that
  5. Hit the route with the thrown error and see the runtime exception.

Expected Behavior

The types should warn that the data property could be undefined.

Actual Behavior

Meta functions are called for error boundaries so the data property that's passed could be undefined. The types don't allow for this currently.

@kentcdodds
Copy link
Member Author

I made a PR which may help explain what I need: #5787

@machour machour added the v2 Issues related to v2 apis label Apr 26, 2023
@brophdawg11 brophdawg11 added feat:typescript feat:links-meta Issues related to links()/meta() labels May 4, 2023
@brophdawg11
Copy link
Contributor

Fixed by #6231, will be available in the next release (likely 1.17.0)

@brophdawg11 brophdawg11 added bug Something isn't working awaiting release This issue has been fixed and will be released soon and removed bug:unverified labels May 5, 2023
@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label Dec 14, 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 feat:links-meta Issues related to links()/meta() feat:typescript v2 Issues related to v2 apis
Projects
None yet
Development

No branches or pull requests

3 participants