Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Constructor param typed `ns.Foo` (namespace-qualified) compiles to ɵɵinvalidFactoryDep

クローズ
#633 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@edbzn がすでに取り組んでいます。

2026年10月25日 から。

  • #634 @edbzn による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
angular, rust, typescript
領域
backend, compilers

調査の方向性

Start with the ngtsc spec cases named in the issue and trace how extract_param_token handles constructor parameter types, comparing TSQualifiedName handling with the resolution used by setClassMetadata. The expected result is generated ɵɵinject calls for namespace-qualified types; verify both namespace and named imports against the reported cases. Pull request #634 is already open for this issue.

索引モデルが issue の本文から書いたものです。

説明

Summary

A constructor parameter typed with a qualified name on an import (ns.Zero, ns.one.One) compiles to ɵɵinvalidFactoryDep, so instantiating the class throws at runtime. ngc treats the qualified name as a value reference, the same as a plain imported name. Applies to @Injectable, @Component, @Directive, @Pipe and @NgModule factories.

Found by running Angular's ngtsc spec ngtsc_spec.ts: "should generate correct imports for type references to namespaced symbols using a namespace import" (and "... using named imports") against oxc.

Reproduction

import {Injectable} from '@angular/core';
import * as ns from './ns'; // export class Zero {}; export namespace one { export class One {} }

@Injectable()
export class MyService {
  constructor(zero: ns.Zero, one: ns.one.One) {}
}
Actual
return new (__ngFactoryType__ || MyService)(i0.ɵɵinvalidFactoryDep(0), i0.ɵɵinvalidFactoryDep(1));
Expected (ngc)
import * as i1 from "./ns";
return new (__ngFactoryType__ || MyService)(i0.ɵɵinject(i1.Zero), i0.ɵɵinject(i1.one.One));

With a named import (import {ns} from './ns'), ngc emits i0.ɵɵinject(i1.ns.Zero).

Cause

The DI token extraction (extract_param_token) returns no token for a TSQualifiedName, while setClassMetadata already resolves the same type ({type: i1.one.One}).

主要言語
Rust
スター
244
フォーク
26
平均マージ
23時間 41分
マージ済み PR(30日)
106

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/oxc-angular-compiler のほかの issue

voidzero-dev/oxc-angular-compiler の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。