exports "./getPolyfill" points at getPolyfill.js, but the package ships polyfill.js
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- api
調査の方向性
package.json から始め、./getPolyfill の export を同梱されている polyfill.js および index.js の require パスと比較します。提供されている Node の import コマンドで失敗を再現し、選択した export 規約によって package から正常に解決され、公開されているファイル一覧との一貫性が保たれることを確認します。
索引モデルが issue の本文から書いたものです。
説明
The problem
package.json maps "./getPolyfill" to "./getPolyfill.js", and the package ships polyfill.js. There is no getPolyfill.js, on main or in the published tarball, so that subpath cannot be imported.
Reproduce
npm i string.prototype.repeat@1.0.0
node --input-type=module -e "await import('string.prototype.repeat/getPolyfill')"
ERR_MODULE_NOT_FOUND: Cannot find module '.../string.prototype.repeat/getPolyfill.js'
Details
"exports": {
".": "./index.js",
"./auto": "./auto.js",
"./shim": "./shim.js",
"./getPolyfill": "./getPolyfill.js", <- no such file
"./implementation": "./implementation.js",
"./package.json": "./package.json"
}
Contents of the published 1.0.0 tarball: LICENSE-MIT.txt, README.md, auto.js, implementation.js, index.js, package.json, polyfill.js, shim.js, tests/.
The other four subpaths all resolve; this is the only one that does not.
Node performs no extension or name search on an exports target — it is taken exactly as written — so nothing falls back to polyfill.js.
Two ways to fix it, and which one you want depends on the convention you'd rather keep:
- point the mapping at the file that exists —
"./getPolyfill": "./polyfill.js", or - rename
polyfill.jstogetPolyfill.js, which is what the sibling es-shims packages call it and whatindex.jswould then require.
Happy to open a PR for whichever you prefer.
Notes
Found by an automated checker I'm building that compares a manifest's declared entry points against the files a package actually ships. I verified this one by hand against the published 1.0.0 tarball and against main before filing.
- 主要言語
- JavaScript
- スター
- 28
- フォーク
- 8
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mathiasbynens/String.prototype.repeat のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
mathiasbynens/String.prototype.repeat#9 · コメント 2 件 ·
mathiasbynens/String.prototype.repeat の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
apache/cloudstack#14222 ·
-
Browser Waiting for: Product Owner
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
getsentry/sentry-javascript#24577 · コメント 1 件 ·
-
curation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
amponce/archive-movie-browser#186 ·
-
light
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
aemdemos/patients-stryker#253 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
clerk/javascript#9852 ·