vitejs/vite · error · Error

currently full bundle mode is only available for client envi

Error message

currently full bundle mode is only available for client environment

What it means

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.

Source

Thrown at packages/vite/src/node/server/bundledDev.ts:95

  private reloadNeededClientIds = new Set<string>()
  private debouncedReloadNeededFlush = debounce(20, () => {
    if (this.lastBuildError || this.reloadNeededClientIds.size === 0) return
    for (const clientId of this.reloadNeededClientIds) {
      this.clients.get(clientId)?.send({ type: 'full-reload', path: '*' })
    }
    this.reloadNeededClientIds.clear()
    this.environment.logger.info(colors.green(`page reload`), {
      timestamp: true,
    })
  })

  private lastBuildError: Error | null = null

  memoryFiles: MemoryFiles = new MemoryFiles()

  constructor(private environment: DevEnvironment) {
    if (environment.name !== 'client') {
      throw new Error(
        'currently full bundle mode is only available for client environment',
      )
    }
  }

  private get devEngine(): DevEngine {
    if (!this._devEngine) {
      throw new Error(`dev engine was not yet initialized`)
    }
    return this._devEngine
  }

  private pendingPayloadFilenames = new Set<string>()

  async listen(): Promise<void> {
    this._closed = false
    debug?.('INITIAL: setup bundle options')
    const rolldownOptions = await this.getRolldownOptions()

View on GitHub (pinned to 89620f09af)

Solutions

  1. Only enable isBundled / experimental.bundledDev for the client environment; keep SSR/worker environments on the default module graph.
  2. Remove isBundled: true from the offending environment in config.environments.
  3. If you need bundling for SSR, use the production build pipeline instead of BundledDev.

Example fix

// before
export default defineConfig({
  environments: { ssr: { isBundled: true } },
  experimental: { bundledDev: true },
})

// after: bundled dev only on client
export default defineConfig({
  experimental: { bundledDev: true },
})
Defensive patterns

Strategy: validation

Validate before calling

function assertClientOnlyBundledDev(config: { environments?: Record<string, { isBundled?: boolean }> }) {
  for (const [name, env] of Object.entries(config.environments ?? {})) {
    if (env.isBundled && name !== 'client') {
      throw new Error(`isBundled is only supported on client, not on "${name}"`)
    }
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vitejs/vite@89620f09af (2026-08-03). Data as JSON: /data/errors/c78148c767dca92b.json. Report an issue: GitHub.