vitejs/vite · error · Error

Not implemented

Error message

Not implemented

What it means

Thrown inside the esbuild-to-rolldown plugin converter (`adapterPlugin`). The `pluginBuild.initialOptions` object is a Proxy exposing only `platform` and `plugins`; reading any other property that an esbuild plugin expects on `build.initialOptions` (e.g. `bundle`, `target`, `format`, `entryPoints`) trips the proxy's get trap. The converter only supports a subset of the esbuild plugin API.

Solutions

  1. Stop reading unsupported `initialOptions` keys in the plugin's setup; pass needed values through plugin config instead.
  2. Replace the esbuild plugin with a native rolldown plugin using `resolveId`/`load` hooks.
  3. Read only `initialOptions.platform` or `initialOptions.plugins`, which the proxy supports.
  4. If you only need options reflection, capture them outside the plugin and close over them.
  5. File/track an issue: extend the adapter target object with the missing key if broadly needed.

Example fix

// before
setup(build) {
  if (build.initialOptions.target?.includes('esnext')) { /* ... */ }
}

// after
setup(build) {
  // pass target via plugin options instead of reading initialOptions
  if (opts.target?.includes('esnext')) { /* ... */ }
}
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_INITIAL_OPTIONS = new Set(['platform', 'plugins'])
function assertEsbuildPluginSafe(plugin: { setup: (b: any) => void }) {
  const probe: any = new Proxy({ platform: 'node', plugins: [] }, {
    get(t, p) {
      if (SUPPORTED_INITIAL_OPTIONS.has(p as string)) return t[p]
      throw new Error(`plugin reads unsupported initialOptions.${String(p)}`)
    },
  })
  plugin.setup({ initialOptions: probe, onStart() {}, onEnd() {}, onResolve() {}, onLoad() {}, onDispose() {}, resolve() {} })
}
// assertEsbuildPluginSafe(myEsbuildPlugin) before registering it

Type guard

function usesOnlySupportedInitialOptions(plugin: { setup: (b: any) => void }): boolean {
  let safe = true
  const probe = new Proxy({ platform: 'node', plugins: [] }, { get(t, p) { if (p in t) return (t as any)[p]; safe = false; return undefined } })
  try { plugin.setup({ initialOptions: probe } as any) } catch { /* ignore setup errors */ }
  return safe
}

Try / catch

try {
  await build()
} catch (e) {
  if (e instanceof Error && e.message === 'Not implemented') {
    console.error('An esbuild plugin reads an unsupported initialOptions key; migrate it to rolldown.')
  }
  throw e
}

Prevention

When it happens

Trigger: An esbuild-compatible plugin registered in `optimizeDeps.rolldownOptions.plugins` (or a Vite plugin adapted via this converter) reads `build.initialOptions.<unsupportedKey>` inside its `setup(build)`. At pluginConverter.ts:72 the proxy throws because the key is not in the target.

Common situations: Porting an esbuild plugin to Vite's rolldown-powered optimizer. Plugin introspects `initialOptions.entryPoints` or `target` to branch logic. Vite version upgrade switched the dep optimizer backend to rolldown and the adapter is incomplete for that plugin.

Related errors


AI-assisted analysis of vitejs/vite@b4d66fee14 (2026-08-11). Data as JSON: /api/errors/3671e7d832867259. Report an issue: GitHub.

Appendix: source

Thrown at packages/vite/src/node/optimizer/pluginConverter.ts:72

        {
          platform,
          plugins:
            plugins?.flatMap((p) =>
              p && 'name' in p
                ? [
                    {
                      name: p.name,
                      // eslint-disable-next-line @typescript-eslint/no-empty-function
                      setup() {},
                    },
                  ]
                : [],
            ) ?? [],
        },
        {
          get(target, p, _receiver) {
            if (p in target) return (target as any)[p]
            throw new Error('Not implemented')
          },
        },
      ) as esbuild.BuildOptions,
      resolve() {
        throw new Error('Not implemented')
      },
      onStart(callback) {
        onStartCallbacks.push(callback)
      },
      onEnd(callback) {
        onEndCallbacks.push(callback)
      },
      onResolve(options, callback) {
        onResolveCallbacks.push([options, callback])
      },
      onLoad(options, callback) {
        onLoadCallbacks.push([options, callback])
      },

View on GitHub (pinned to b4d66fee14)