stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.93k stars 172 forks source link

webcontainer becomes unresponsive for >1 minute with recursive fs.watch after installing dependency #1569

Open bigmistqke opened 3 weeks ago

bigmistqke commented 3 weeks ago

Describe the bug

After installing p.ex vinxi with webContainer.fs.watch('.', { recursive: true }, callback) the webcontainer becomes unresponsive after the dependency is installed for more then a minute (72s). If I don't watch recursively this delay does not happen.

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-j9vwpr?file=main.js

Steps to reproduce

  1. let the package install itself
  2. notice how it takes > 1 minute to read the package.json after the package is installed (stackblitz' editor also becomes unresponsive during this time)

Expected behavior

to not take so long.

Parity with Local

Screenshots

No response

Platform

Additional context

No response