[Lightning] Web build fails due to react-router-dom v6 incompatibility
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
### 1. Minimal Reproduce Step (Required)
Run the following command:
```bash
make lightning_web
```
### 2. What did you expect to see? (Required)
The command should execute successfully and build the Lightning web frontend.
### 3. What did you see instead? (Required)
Build failed with the following errors:
```
ERROR in /Users/leon/WorkSpace/database/tidb/lightning/web/src/index.tsx
19:24-32
[tsl] ERROR in /Users/leon/WorkSpace/database/tidb/lightning/web/src/index.tsx(19,25)
TS2724: '"react-router-dom"' has no exported member named 'Redirect'. Did you mean 'redirect'?
ERROR in /Users/leon/WorkSpace/database/tidb/lightning/web/src/index.tsx
19:41-47
[tsl] ERROR in /Users/leon/WorkSpace/database/tidb/lightning/web/src/index.tsx(19,42)
TS2305: Module '"react-router-dom"' has no exported member 'Switch'.
ERROR in /Users/leon/WorkSpace/database/tidb/lightning/web/src/index.tsx
163:32-40
[tsl] ERROR in /Users/leon/WorkSpace/database/tidb/lightning/web/src/index.tsx(163,33)
TS7031: Binding element 'location' implicitly has an 'any' type.
webpack 5.94.0 compiled with 3 errors and 2 warnings in 5465 ms
make: *** [lightning_web] Error 1
```
### 4. What is your TiDB version? (Required)
This issue affects TiDB versions **v8.4.0 and later**.
### Root Cause
This is caused by [[PR #55975](https://github.com/pingcap/tidb/pull/55975)](https://github.com/pingcap/tidb/pull/55975), which upgrades `react` and `react-router-dom` to newer versions that are incompatible with the current Lightning frontend code.
Although this does not affect the functionality of the Lightning frontend itself, it **prevents successful frontend builds** if any changes are made to the web source code.
Contributor guide
Assessment
This issue has not been assessed yet.