Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turn off file watchers #1327

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

evertbouw
Copy link

I thought I was running into this problem laravel/vite-plugin#152 but it was happening in prod builds, so none of the suggestions worked. I traced where the watchers were coming from and it was vanilla-extract. I patched in watch: null in my project and now CI/CD builds are working again.

Copy link

changeset-bot bot commented Feb 16, 2024

🦋 Changeset detected

Latest commit: f39c1b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vanilla-extract/integration Patch

Not sure what this means? Click here to learn what changesets are.

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

@mrm007
Copy link
Contributor

mrm007 commented Feb 19, 2024

Thanks @evertbouw!

Is your project public or do you have a way to reproduce this? I might write an integration test for the compiler if it's something that can be automated.

@evertbouw
Copy link
Author

@mrm007 Sorry it's proprietary. I'm guessing if you create more files than the system filewachter limit you should run into this, doesn't seems to happen in macos locally but it did on the linux CI/CD box.

@askoufis
Copy link
Contributor

I wonder if perhaps we're creating multiple compilers, instead of re-using the existing one.
@evertbouw Could you try out this snapshot version of the vite plugin from #1397? 0.0.0-fix-watch-mode-20240429115131.

@evertbouw
Copy link
Author

evertbouw commented May 2, 2024

@askoufis that did not fix the problem.

devDependencies:
- @vanilla-extract/vite-plugin 4.0.9
+ @vanilla-extract/vite-plugin 0.0.0-fix-watch-mode-20240429115131 (4.0.9 is available)

Done in 14.1s

> vite build

vite v5.2.11 building for production...
transforming...
node:internal/errors:496
    ErrorCaptureStackTrace(err);
    ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/forge/application/vendor/nesbot/carbon/src/Carbon/Lang/dua.php'
    at FSWatcher.<computed> (node:internal/fs/watchers:247:19)
    at Object.watch (node:fs:2418:34)
    at createFsWatchInstance (file:///home/forge/application/node_modules/.pnpm/vite@5.2.11_@types+node@20.12.8/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:44360:17)
    at setFsWatchListener (file:///home/forge/application/node_modules/.pnpm/vite@5.2.11_@types+node@20.12.8/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:44407:15)
    at NodeFsHandler._watchWithNodeFs (file:///home/forge/application/node_modules/.pnpm/vite@5.2.11_@types+node@20.12.8/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:44562:14)
    at NodeFsHandler._handleFile (file:///home/forge/application/node_modules/.pnpm/vite@5.2.11_@types+node@20.12.8/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:44626:23)
    at NodeFsHandler._addToNodeFs (file:///home/forge/application/node_modules/.pnpm/vite@5.2.11_@types+node@20.12.8/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:44868:21)
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (file:///home/forge/application/node_modules/.pnpm/vite@5.2.11_@types+node@20.12.8/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:46061:10)
    at NodeFsHandler._addToNodeFs (file:///home/forge/application/node_modules/.pnpm/vite@5.2.11_@types+node@20.12.8/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:44876:18) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/forge/application/vendor/nesbot/carbon/src/Carbon/Lang/dua.php',
  filename: '/home/forge/application/vendor/nesbot/carbon/src/Carbon/Lang/dua.php'
}

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.

None yet

3 participants