web-infra-dev / web-infra-dev/modern.js
[Bug]: [V3] redirecting doesn't work within actions
Open
@zllkjc is already working on this.
Since May 11, 2026.
- Dominant language
- TypeScript
- Stars
- 5k
- Forks
- 421
- Avg merge
- 6d 2h
- Merged PRs (30d)
- 50
Description
Version
System:
OS: macOS 26.4
CPU: (10) arm64 Apple M1 Pro
Memory: 1000.30 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Safari: 26.4
npmPackages:
@modern-js/app-tools: ^3.1.2 => 3.1.3
@modern-js/plugin-bff: ^3.1.2 => 3.1.3
@modern-js/runtime: ^3.1.2 => 3.1.3
@modern-js/server-runtime: ^3.1.2 => 3.1.3
@modern-js/tsconfig: ^3.1.2 => 3.1.3
Details
Redirecting to any page in an action doesn't work at all.
// some-route/page.data.ts
import { redirect } from '@modern-js/runtime/router';
export async function action() {
throw redirect('/dashboard');
// or return redirect('/dashboard')
}
Reproduce link
can be reproducible with a simple starter app
Reproduce Steps
can be reproducible with a simple starter app.
- create two pages in routes folder (page-a.tsx, page-b.tsx, page-b.data.ts)
- write an action method in
page-b.data.tswith redirect topage-a - Run the app
- redirect to page-b
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.