Skip to content

Conversation

dejarp
Copy link

@dejarp dejarp commented Oct 14, 2025

The webview-ui vite server watches too many files to the point of consuming ALL os file watchers, and when it hits that limit the dev server can't start which means the ui never loads. This change restricts it to only watch files that might potentially require build steps, and switches to polling method to make it less aggressive.

…watchers. this should reduce it to only src files whose modification might necessitate rebuilding
Copy link

changeset-bot bot commented Oct 14, 2025

⚠️ No Changeset found

Latest commit: 3c212e0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mcowger
Copy link
Contributor

mcowger commented Oct 14, 2025

I like the careful restriction of watched files in this.

But I'm not a fan of switching to polling.

…ready handles rebuilding when watched files are changed, so we should just need to remove the i18n locales folder from the ignored list. the setupLocaleWatcher was the thing making the dev process consume all the file watchers, but having too many files not ignored definately contributed. can tell because if you look in the web tools console the first file it fails to watch is a vscode config file from outside the entire project folder, which means that it ran out of file watchers before the extension started, but did so gracefully. then the extension tried to setup more watchers (actually necessary ones for config files and settings files and that's when it fails and dev process exits
… just needed to allow vite to access files outside of its root dir, which includes locales in the src package
@dejarp
Copy link
Author

dejarp commented Oct 14, 2025

the locales files are actually json and they need a build step of copy when changed. there's a lot of them but not so many that it exhausts available watchers, so i removed json from ignore list, and added the path to the i18n locales in src as an allowed path for vite to access outside of its directory structure, then add it to the ignore list with a "!" indicating that it is something that should not be ignored when vite sets up watchers. that should make locales file trigger the build which triggers the copy, or something like that. it's confusing, and GLM wasn't much help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants