{"record":{"id":"8cc61c0668d38a1b","repo":"vercel/next.js","slug":"environment-doesn-t-support-lazy-compilation-requ","errorCode":null,"errorMessage":"Environment doesn't support lazy compilation (requires EventSource)","messagePattern":"Environment doesn't support lazy compilation \\(requires EventSource\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/bundles/webpack/packages/lazy-compilation-web.js","lineNumber":6,"sourceCode":"/* global __resourceQuery */\n\n\"use strict\";\n\nif (typeof EventSource !== \"function\") {\n\tthrow new Error(\n\t\t\"Environment doesn't support lazy compilation (requires EventSource)\"\n\t);\n}\n\nvar urlBase = decodeURIComponent(__resourceQuery.slice(1));\n/** @type {EventSource | undefined} */\nvar activeEventSource;\nvar activeKeys = new Map();\nvar errorHandlers = new Set();\n\nvar updateEventSource = function updateEventSource() {\n\tif (activeEventSource) activeEventSource.close();\n\tif (activeKeys.size) {\n\t\tactiveEventSource = new EventSource(\n\t\t\turlBase + Array.from(activeKeys.keys()).join(\"@\")\n\t\t);\n\t\t/**\n\t\t * @this {EventSource}","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/bundles/webpack/packages/lazy-compilation-web.js#L1-L24","documentation":"Feature-detection guard at module load of webpack's lazy-compilation runtime: the browser environment lacks a functional EventSource constructor, which the lazy-compilation backchannel requires. Because the module throws at evaluation time, any build using lazy compilation fails as soon as this chunk loads in the unsupported environment.","triggerScenarios":"Lazy compilation client code runs in an environment without EventSource support.","commonSituations":"Experimental lazy compilation is enabled but the browser or test environment lacks EventSource.","solutions":["Use a browser/environment that supports EventSource, or disable experimental lazy compilation for client components."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}