Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
`openAsBlob` fails synchronously | GoodFirstPicks

`openAsBlob` fails synchronously

nodejs/node 2 comments 7d ago
View on GitHub
lowopenScope: clearSkill match: yesTest focusedNode.jsJavaScript

Why this is a good first issue

The issue clearly describes a bug where `openAsBlob` fails synchronously instead of returning a rejected promise.

AI Summary

The issue reports that `openAsBlob` fails synchronously rather than returning a rejected promise as expected. The fix involves ensuring the function properly returns a promise in all cases. The maintainer feedback suggests this is a known inconsistency in the API design.

Issue Description

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.

GitHub Labels

fs

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • API consistency
  • backward compatibility
Loading labels...

Details

Points10 pts
Difficultylow
Scopeclear
Skill Matchyes
Test Focusedyes