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

Don't treat a route as a resource route if it only has an ErrorBoundary #6106

Closed
1 task done
brophdawg11 opened this issue Apr 19, 2023 · 4 comments · Fixed by #6125
Closed
1 task done

Don't treat a route as a resource route if it only has an ErrorBoundary #6106

brophdawg11 opened this issue Apr 19, 2023 · 4 comments · Fixed by #6125
Labels
bug Something isn't working

Comments

@brophdawg11
Copy link
Contributor

brophdawg11 commented Apr 19, 2023

What version of Remix are you using?

1.15.0

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

  • Yes

Steps to Reproduce

import {
  Outlet,
  isRouteErrorResponse,
  useRouteError,
} from "@remix-run/react";

// this is required to make this a UI route, but we should be able to 
// default to this if no default is exported but a boundary is
// export default Outlet;

export function ErrorBoundary() {
  let error = useRouteError();
  // ...
}

Expected Behavior

Any route exporting a default component, ErrorBoundary, or CatchBoundary is considered a UI route.

Actual Behavior

Only routes exporting a default component are considered a UI route.

@brophdawg11 brophdawg11 added bug:unverified bug Something isn't working and removed bug:unverified labels Apr 19, 2023
@brophdawg11 brophdawg11 self-assigned this Apr 19, 2023
@kiliman
Copy link
Collaborator

kiliman commented Apr 19, 2023

Interesting. I wonder what scenarios you would want to export an ErrorBoundary but not a default UI component.

To me, I think it should be an error instead of treating it as a resource route, since they don't have UI.

@brophdawg11
Copy link
Contributor Author

The use-case I've seen is a singular top level error boundary in a pathless route below root - so it can still access valid loader data from the root loader (i18n info, etc.). I think that might be the use-case Ryan was doing when he ran into it today.

@brophdawg11 brophdawg11 added the awaiting release This issue has been fixed and will be released soon label Apr 21, 2023
@brophdawg11 brophdawg11 removed their assignment Apr 21, 2023
@brophdawg11
Copy link
Contributor Author

Fixed in #6125 - should be released in Remix 1.16

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-e696522-20230422 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants