router icon indicating copy to clipboard operation
router copied to clipboard

ErrorElement not rendered

Open DiederikvandenB opened this issue 2 years ago • 13 comments

Describe the bug

I am not sure the errorElement is working as it should, or whether I am misunderstanding it.

See this fork of the basic example: https://codesandbox.io/s/stupefied-mountain-6shsph?file=/src/index.tsx

I would expect the <h1>error</h1> to be rendered for the root page, yet I see the normal element. Is this a bug?

Cheers

Your Example Website or App

https://codesandbox.io/s/stupefied-mountain-6shsph?file=/src/index.tsx

Steps to Reproduce the Bug or Issue

  1. Click on home
  2. See "Welcome Home!"

Expected behavior

  1. Click on home
  2. See <div><h1>error</h1></div>

Screenshots or Videos

No response

Platform

  • OS: macOS 12.3
  • Browser: Safari 15.4
  • Version: 3.7.4

Additional context

No response

DiederikvandenB avatar Apr 02 '22 14:04 DiederikvandenB

https://github.com/TanStack/react-location/discussions/249 I see this issue was reported here too. However, I went all the way back to the latest stable version (3.5.2 I believe?) and even there the issue occurred.

DiederikvandenB avatar Apr 02 '22 16:04 DiederikvandenB

Known issue. Working on it.

Tanner Linsley On Apr 2, 2022, 9:48 AM -0700, Diederik van den Burger @.***>, wrote:

#249 I see this issue was reported here too. However, I went all the way back to the latest stable version (3.5.2 I believe?) and even there the issue occurred. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

tannerlinsley avatar Apr 02 '22 16:04 tannerlinsley

Anything I can do to help? I wouldn't mind diving in to the code and submit a PR, if you're not too close to fixing it yourself already.

DiederikvandenB avatar Apr 12 '22 19:04 DiederikvandenB

Does anyone have a workaround for this issue?

robcaldecott avatar Apr 20 '22 12:04 robcaldecott

@robcaldecott not sure if this is the way to go for this problem, but for me it seems to resolve the issue.

https://github.com/DiederikvandenB/react-location/commit/4b7d9c943811836c449d650c2d4c5b708d58aca4

DiederikvandenB avatar Apr 25 '22 20:04 DiederikvandenB

Hi @tannerlinsley, could you provide an update on this bug's status? If you can't deal with this right now, that's perfectly fine of course, but if support for this package is not on your roadmap, we'd love to hear that now before fully committing to using it.

DiederikvandenB avatar May 03 '22 20:05 DiederikvandenB

@DiederikvandenB same here. I'm hesitating between react-router or react-location, some features of react-location are appealing but it feels unfinished.

JesusTheHun avatar May 04 '22 20:05 JesusTheHun

I am working on a fix for this, but don't have an ETA yet. I'm pretty heads down in React Table this week. Re: @DiederikvandenB, I would say unless you're in dire need of the better search param APIs of react-location, you'd be better off waiting for the next react-router version with all of the async loader features.

tannerlinsley avatar May 04 '22 21:05 tannerlinsley

Alright, thanks for your response Tanner!

DiederikvandenB avatar May 05 '22 15:05 DiederikvandenB

Is there any update on this?

tom-ricci avatar May 24 '22 02:05 tom-ricci

@robcaldecott not sure if this is the way to go for this problem, but for me it seems to resolve the issue.

DiederikvandenB@4b7d9c9

If you're still using this workaround, has it continued working for you? I'm thinking of just doing the same thing you did but I'm not sure if it'll break anything else.

tom-ricci avatar May 27 '22 16:05 tom-ricci

@tom-ricci, it seems to be running stable, but only in our develop environment. UAT starts this week.

We are however still considering switching back to react-router once their merge with Remix' router is finished. See: https://github.com/remix-run/react-router/pull/8855 and https://github.com/remix-run/react-router/tree/remixing

DiederikvandenB avatar May 30 '22 09:05 DiederikvandenB

I've submitted a PR to fix this: https://github.com/TanStack/react-location/pull/290

badsyntax avatar Jun 16 '22 07:06 badsyntax

This

tannerlinsley avatar Nov 10 '22 14:11 tannerlinsley