{"record":{"id":"4de766c03b92b587","repo":"parcel-bundler/parcel","slug":"responding-to-file-system-events-exceeded-threshol","errorCode":null,"errorMessage":"Responding to file system events exceeded threshold, start with empty cache.","messagePattern":"Responding to file system events exceeded threshold, start with empty cache\\.","errorType":"exception","errorClass":"FSBailoutError","httpStatus":null,"severity":"warning","filePath":"packages/core/core/src/RequestTracker.js","lineNumber":876,"sourceCode":"    let predictedTime = 0;\n    let startTime = Date.now();\n\n    for (let {path: _path, type} of events) {\n      if (++count === 256) {\n        let duration = Date.now() - startTime;\n        predictedTime = duration * (events.length >> 8);\n        if (predictedTime > threshold) {\n          logger.warn({\n            origin: '@parcel/core',\n            message:\n              'Building with clean cache. Cache invalidation took too long.',\n            meta: {\n              trackableEvent: 'cache_invalidation_timeout',\n              watcherEventCount: events.length,\n              predictedTime,\n            },\n          });\n          throw new FSBailoutError(\n            'Responding to file system events exceeded threshold, start with empty cache.',\n          );\n        }\n      }\n\n      let _filePath = toProjectPath(options.projectRoot, _path);\n      let filePath = fromProjectPathRelative(_filePath);\n      let hasFileRequest = this.hasContentKey(filePath);\n\n      // If we see a 'create' event for the project root itself,\n      // this means the project root was moved and we need to\n      // re-run all requests.\n      if (type === 'create' && filePath === '') {\n        logger.verbose({\n          origin: '@parcel/core',\n          message:\n            'Watcher reported project root create event. Invalidate all nodes.',\n          meta: {","sourceCodeStart":858,"sourceCodeEnd":894,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/core/core/src/RequestTracker.js#L858-L894","documentation":"During incremental builds Parcel processes file-watcher events. It estimates the cost of responding to the event batch (`duration * (events.length >> 8)`) and compares it to a threshold. When the predicted work exceeds the threshold, it raises an `FSBailoutError` and falls back to a clean-cache build rather than spending excessive time invalidating. This is a soft bailout, not a hard failure — the build continues from scratch.","triggerScenarios":"A large batch of filesystem events (e.g. branch switch, mass rename, dependency reinstall) that floods the watcher beyond the cost threshold.","commonSituations":"Switching git branches with many changed files; `npm install` churning node_modules; large monorepo checkouts; deleting and recreating build trees.","solutions":["Treat as informational — the next build will use a clean cache automatically.","Reduce watcher noise by ignoring volatile dirs (node_modules, build output, .git) in the watcher config.","If it recurs, run `parcel build --no-cache` once to reset, then continue normally."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// This is a watcher-driven bailout; pre-empt by reducing event volume.\n// Configure the watcher to ignore volatile directories.\nnew Parcel({\n  // ensure watcher ignores node_modules / dist / .git\n});","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add volatile dirs (node_modules, build output, .git) to watcher ignores.","Avoid large branch switches while a watch build is running.","Treat the message as informational — a clean build follows automatically."],"tags":["watcher","cache","performance","incremental"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}