mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
fix: enable polling in chokidar to prevent EMFILE errors on macOS (#13281)
This commit is contained in:
parent
4496dae57d
commit
1da1bb5a02
@ -903,6 +903,9 @@ export class ServerlessEngineDevMode {
|
||||
},
|
||||
ignoreInitial: true,
|
||||
followSymlinks: false,
|
||||
// usePolling is enabled because chokidar v4 removed fsevents support,
|
||||
// causing "EMFILE: too many open files" errors on macOS with large projects
|
||||
usePolling: true,
|
||||
// Add debounce to prevent rapid-fire events
|
||||
awaitWriteFinish: {
|
||||
stabilityThreshold: 300,
|
||||
|
||||
@ -105,10 +105,13 @@ class AwsDev {
|
||||
mainProgress.notice('Connecting')
|
||||
|
||||
// TODO: This should be applied more selectively
|
||||
// usePolling is enabled because chokidar v4 removed fsevents support,
|
||||
// causing "EMFILE: too many open files" errors on macOS with large projects
|
||||
chokidar
|
||||
.watch(this.serverless.config.serviceDir, {
|
||||
ignored: /\.serverless/,
|
||||
ignoreInitial: true,
|
||||
usePolling: true,
|
||||
})
|
||||
.on('all', async (event, path) => {
|
||||
await this.serverless.pluginManager.spawn('dev-build')
|
||||
@ -751,12 +754,16 @@ class AwsDev {
|
||||
this.serverless.configurationFilename,
|
||||
)
|
||||
|
||||
chokidar.watch(configFilePath).on('change', (event, path) => {
|
||||
logger.warning(
|
||||
`If you've made infrastructure changes, restart the dev command w/ "serverless dev"`,
|
||||
)
|
||||
logger.blankLine()
|
||||
})
|
||||
chokidar
|
||||
.watch(configFilePath, {
|
||||
usePolling: true,
|
||||
})
|
||||
.on('change', (event, path) => {
|
||||
logger.warning(
|
||||
`If you've made infrastructure changes, restart the dev command w/ "serverless dev"`,
|
||||
)
|
||||
logger.blankLine()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user