`openAsBlob` fails synchronously
オープン
初心者向け
まだ誰も着手していません。
fs
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.4k
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 272
説明
Version
v24.14.0
Platform
Linux vali 6.18.7-76061807-generic #202601231045~1769703228~24.04~cb87b5b SMP PREEMPT_DYNAMIC Thu J x86_64 x86_64 x86_64 GNU/Linux
Subsystem
fs
What steps will reproduce the bug?
import { openAsBlob } from 'node:fs'
const result = await openAsBlob('does-not-exist').catch((error) => {})
console.log(result)
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
I expect openAsBlob() to always return a promise. If there are any problems, I expect the promise to be rejected.
What do you see instead?
Instead of returning a promise that’s rejected, openAsBlob() fails synchronously. This means that instead of using the Promise.catch() method, you have to use try/catch logic instead.
Additional information
Just marking the function as async on https://github.com/nodejs/node/blob/v25.8.1/lib/fs.js#L570 would fix it.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
参照されている行の openAsBlob() の実装付近にある lib/fs.js から始め、提供されている存在しないパスの例で失敗を再現します。周辺の fs テストを確認するか、エラーケースのカバレッジを追加します。openAsBlob() が promise を返し、存在しないパスが同期的な throw ではなく promise の拒否によって報告されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 活発
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 78/100