{"id":"c78148c767dca92b","repo":"vitejs/vite","slug":"currently-full-bundle-mode-is-only-available-for-c","errorCode":null,"errorMessage":"currently full bundle mode is only available for client environment","messagePattern":"currently full bundle mode is only available for client environment","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vite/src/node/server/bundledDev.ts","lineNumber":95,"sourceCode":"  private reloadNeededClientIds = new Set<string>()\n  private debouncedReloadNeededFlush = debounce(20, () => {\n    if (this.lastBuildError || this.reloadNeededClientIds.size === 0) return\n    for (const clientId of this.reloadNeededClientIds) {\n      this.clients.get(clientId)?.send({ type: 'full-reload', path: '*' })\n    }\n    this.reloadNeededClientIds.clear()\n    this.environment.logger.info(colors.green(`page reload`), {\n      timestamp: true,\n    })\n  })\n\n  private lastBuildError: Error | null = null\n\n  memoryFiles: MemoryFiles = new MemoryFiles()\n\n  constructor(private environment: DevEnvironment) {\n    if (environment.name !== 'client') {\n      throw new Error(\n        'currently full bundle mode is only available for client environment',\n      )\n    }\n  }\n\n  private get devEngine(): DevEngine {\n    if (!this._devEngine) {\n      throw new Error(`dev engine was not yet initialized`)\n    }\n    return this._devEngine\n  }\n\n  private pendingPayloadFilenames = new Set<string>()\n\n  async listen(): Promise<void> {\n    this._closed = false\n    debug?.('INITIAL: setup bundle options')\n    const rolldownOptions = await this.getRolldownOptions()","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/vitejs/vite/blob/89620f09afcfef6b35e7bb8660132ab5b4d0cd3b/packages/vite/src/node/server/bundledDev.ts#L77-L113","documentation":"BundledDev (experimental full-bundle dev mode) only supports the 'client' environment; its constructor at packages/vite/src/node/plugins/../server/bundledDev.ts:95 throws if environment.name !== 'client'. The feature drives the HMR/client bundle through rolldown and is meaningless for SSR/worker/other custom environments.","triggerScenarios":"Marking a non-client environment isBundled: true (e.g. an SSR environment with bundledDev enabled); enabling experimental.bundledDev globally and having a custom environment whose options set isBundled; misconfiguring environments.ssr.isBundled.","commonSituations":"Adopting experimental.bundledDev before realizing it is client-only; copy-pasting environment config from client to ssr including isBundled; plugin that auto-enables bundled dev for all environments.","solutions":["Only enable isBundled / experimental.bundledDev for the client environment; keep SSR/worker environments on the default module graph.","Remove isBundled: true from the offending environment in config.environments.","If you need bundling for SSR, use the production build pipeline instead of BundledDev."],"exampleFix":"// before\nexport default defineConfig({\n  environments: { ssr: { isBundled: true } },\n  experimental: { bundledDev: true },\n})\n\n// after: bundled dev only on client\nexport default defineConfig({\n  experimental: { bundledDev: true },\n})","handlingStrategy":"validation","validationCode":"function assertClientOnlyBundledDev(config: { environments?: Record<string, { isBundled?: boolean }> }) {\n  for (const [name, env] of Object.entries(config.environments ?? {})) {\n    if (env.isBundled && name !== 'client') {\n      throw new Error(`isBundled is only supported on client, not on \"${name}\"`)\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat experimental.bundledDev as client-only and do not set isBundled on ssr/worker environments.","Review every environments.*.isBundled flag when adopting bundled dev.","Use the production build pipeline for SSR if you need bundling there."],"tags":["dev-server","bundled-dev","environment","experimental"],"analyzedSha":"89620f09afcfef6b35e7bb8660132ab5b4d0cd3b","analyzedAt":"2026-08-03T19:28:02.920Z","schemaVersion":2}