Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Typechecking error when using `Run.href()` with 2nd parameter

Open
#295 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
70/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend, web-dev

Research direction

Start with the minimal reproduction in src/routes/%2Bhandler.ts and run its mtc typecheck. Inspect the Run.href call with the second search-parameter argument and compare it with the single-argument call; done means the two-argument form typechecks in the handler.

Written by the indexing model from the issue text.

Description

mtc doesn't like it when I use Run.href with a 2nd parameter in a handler, but is ok with a single parameter:

Eg:

export const GET = Run.GET(
  async (ctx, next) => {
    // causes typecheck error
    //return ctx.redirect(Run.href("/foo", { search: { foo: "bar" } }));

    //  but this one is ok
    return ctx.redirect(Run.href("/foo"));
  }
);

Minimal reproduction: https://github.com/vwong/marko6-run-href/blob/main/src/routes/%2Bhandler.ts

Dominant language
TypeScript
Stars
175
Forks
16
Avg merge
3d 12h
Merged PRs (30d)
6

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from marko-js/run

All issues in marko-js/run

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.