Typings are silently `any` under moduleResolution node16/nodenext
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- tooling
調査の方向性
src/cjs/*.d.ts に公開されている宣言から始め、moduleResolution nodenext と skipLibCheck を有効にした TypeScript 5.9.3 で問題を再現してください。宣言が TS2835 なしで解決され、strict チェック時に ecpair からのインポートが any になるのではなく型を保持すれば、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
The published typings in src/cjs/*.d.ts use extensionless relative imports:
// src/cjs/index.d.ts
export { ECPairFactory as default, ECPairFactory, ... } from './ecpair';
The root package.json has "type": "module" and there is no nested package.json in
src/cjs/, so TypeScript treats these .d.ts files as ES modules — and in ESM, relative
imports require explicit file extensions. ./ecpair fails to resolve:
src/cjs/index.d.ts(1,166): error TS2835: Relative import paths need explicit file
extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'.
With skipLibCheck: true (the common setup) the error is suppressed, and everything
imported from ecpair is silently any, even under --strict:
import { ECPairFactory } from 'ecpair';
const x: number = ECPairFactory; // compiles without error
Repro: ecpair 3.0.1, TypeScript 5.9.3, --module nodenext --moduleResolution nodenext,
ESM project.
- 主要言語
- JavaScript
- スター
- 29
- フォーク
- 35
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bitcoinjs/ecpair のほかの issue
-
v3.0.0 release notesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
bitcoinjs/ecpair の issue をすべて見る
似ている issue
-
xsd:integer cast from a string rejects negative numbers, a leading + and surrounding whitespaceオープンbug 🐛
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
comunica/comunica#1960 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Waiting for: Product Owner
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
getsentry/sentry-javascript#26203 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bytedance/flowgram.ai#1235 ·
メンテナーはふだん 1 日以内に返信