Skip to content

[fs] Value is sometimes an empty string #513

@kaaax0815

Description

@kaaax0815

Environment

node v22.11.0
macos 14.7.1
unstorage 1.13.1

Reproduction

https://stackblitz.com/edit/vitejs-vite-vdcacm?file=src%2Findex.ts

Describe the bug

Can't reproduce on stackblitz but on local maschine.
As you can see in the code

if (b.some((v) => v.status === 'fulfilled' && v.value === '')) {
  console.log('Something went wrong');
}

it checks if v.value is an empty string (which should never be the case)

but I still get this log

Sending response
Sending response
Sending response
Sending response
Something went wrong
Sending response
Sending response
Sending response
Something went wrong
Sending response
Sending response
Something went wrong

when opening the tab and holding ⌘ Cmd + R

Additional context

Using a package like async-mutex I was able to workaround this bug

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions