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

Inherited arrow-function class field calling this.<other field>() throws 'value is not a function' when the base class is in another module

Open
#12,818 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust, typescript
Domain
compilers

Research direction

Start by reproducing the failure with the supplied base.ts and main.ts examples, then inspect the HIR entry RegisterClassParentDynamic and the compiler’s handling of inherited fields and calls across modules. Done means the Perry example behaves like Node and a regression test covers the cross-module subclass case.

Written by the indexing model from the issue text.

Description

Perry 0.5.1659 (main, 2026-10-18), Linux x86_64.

// base.ts
export class Base {
  children?: unknown
  addChildren = (c: unknown) => this._add(c)
  _add = (c: unknown) => { this.children = c; return this }
}
// main.ts
import { Base } from "./base.ts"
class Sub extends Base { y = 1 }
const r = new Sub()
try { r.addChildren([1]); console.log("ok", r.children) }
catch (e) { console.log("fail", String(e)) }

Node: ok [ 1 ]. Perry: fail TypeError: value is not a function.

  • Same code in one file: works.
  • new Base() (no subclass) across modules: works.
  • Adding an unrelated read such as typeof r._add earlier in main.ts makes it pass, so this looks like a whole-program field or call analysis issue.
  • The HIR shows RegisterClassParentDynamic { parent_expr: ExternFuncRef { name: "Base" } } for Sub.

This blocks TanStack Router: BaseRoute.addChildren calls this._addFileChildren, and RouterCore has 9 arrow fields that call each other (load, buildLocation, ...), with Router extends RouterCore in another package. SSR of a TanStack Start app then fails with "Objects are not valid as a React child". Related: #12742.

Dominant language
Rust
Stars
4.9k
Forks
166
Avg merge
2h 54m
Merged PRs (30d)
922

Getting set up

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 PerryTS/perry

All issues in PerryTS/perry

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.