blitz-js / blitz-js/blitz

ErrorBoundary 400s if fallback is `null`

Open
#3,110 3 comments 0 reactions 0 assignees View on GitHub
kind/feature-change status/ready-to-work-on
Dominant language
TypeScript
Stars
14.1k
Forks
803
PR merge metrics
No merged PRs in 30d

Description

### What is the problem?

ErrorBoundary throws its own error if provided fallback is `null`. This should be valid considering `null` is valid for suspense.

### Paste all your error logs here:

```
requires either a fallback, fallbackRender, or FallbackComponent prop.
```

### Paste all relevant code snippets here:

```



```

### What are detailed steps to reproduce this?

1. Force a component to fail with a parent `null` errorboundary

### Run `blitz -v` and paste the output here:

```
Linux 5.10 | linux-x64 | Node: v14.18.2

blitz: 0.44.4 (local)

Package manager: yarn
System:
OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Memory: 9.78 GB / 15.60 GB
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 14.18.2 - /tmp/yarn--1641434939646-0.40391104769669317/node
Yarn: 1.22.17 - /tmp/yarn--1641434939646-0.40391104769669317/yarn
npm: 6.14.15 - ~/.asdf/plugins/nodejs/shims/npm
Watchman: Not Found
npmPackages:
@prisma/client: 3.7.0 => 3.7.0
blitz: ^0.44.4 => 0.44.4
prisma: ^3.7.0 => 3.7.0
react: 18.0.0-beta-24dd07bd2-20211208 => 18.0.0-beta-24dd07bd2-20211208
react-dom: 18.0.0-beta-24dd07bd2-20211208 => 18.0.0-beta-24dd07bd2-20211208
typescript: ~4.5.4 => 4.5.4

Done in 0.54s.
```

### Please include below any other applicable logs and screenshots that show your problem:

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the ErrorBoundary component and reproduce the reported case with the provided fallback={null} snippet. Check the validation that produces the logged error; done means an ErrorBoundary with a null fallback is accepted without throwing its own error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.