{"record":{"id":"3671e7d832867259","repo":"vitejs/vite","slug":"not-implemented","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vite/src/node/optimizer/pluginConverter.ts","lineNumber":72,"sourceCode":"        {\n          platform,\n          plugins:\n            plugins?.flatMap((p) =>\n              p && 'name' in p\n                ? [\n                    {\n                      name: p.name,\n                      // eslint-disable-next-line @typescript-eslint/no-empty-function\n                      setup() {},\n                    },\n                  ]\n                : [],\n            ) ?? [],\n        },\n        {\n          get(target, p, _receiver) {\n            if (p in target) return (target as any)[p]\n            throw new Error('Not implemented')\n          },\n        },\n      ) as esbuild.BuildOptions,\n      resolve() {\n        throw new Error('Not implemented')\n      },\n      onStart(callback) {\n        onStartCallbacks.push(callback)\n      },\n      onEnd(callback) {\n        onEndCallbacks.push(callback)\n      },\n      onResolve(options, callback) {\n        onResolveCallbacks.push([options, callback])\n      },\n      onLoad(options, callback) {\n        onLoadCallbacks.push([options, callback])\n      },","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/vitejs/vite/blob/b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab/packages/vite/src/node/optimizer/pluginConverter.ts#L54-L90","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Stop reading unsupported `initialOptions` keys in the plugin's setup; pass needed values through plugin config instead.","Replace the esbuild plugin with a native rolldown plugin using `resolveId`/`load` hooks.","Read only `initialOptions.platform` or `initialOptions.plugins`, which the proxy supports.","If you only need options reflection, capture them outside the plugin and close over them.","File/track an issue: extend the adapter target object with the missing key if broadly needed."],"exampleFix":"// before\nsetup(build) {\n  if (build.initialOptions.target?.includes('esnext')) { /* ... */ }\n}\n\n// after\nsetup(build) {\n  // pass target via plugin options instead of reading initialOptions\n  if (opts.target?.includes('esnext')) { /* ... */ }\n}","handlingStrategy":"validation","validationCode":"const SUPPORTED_INITIAL_OPTIONS = new Set(['platform', 'plugins'])\nfunction assertEsbuildPluginSafe(plugin: { setup: (b: any) => void }) {\n  const probe: any = new Proxy({ platform: 'node', plugins: [] }, {\n    get(t, p) {\n      if (SUPPORTED_INITIAL_OPTIONS.has(p as string)) return t[p]\n      throw new Error(`plugin reads unsupported initialOptions.${String(p)}`)\n    },\n  })\n  plugin.setup({ initialOptions: probe, onStart() {}, onEnd() {}, onResolve() {}, onLoad() {}, onDispose() {}, resolve() {} })\n}\n// assertEsbuildPluginSafe(myEsbuildPlugin) before registering it","typeGuard":"function usesOnlySupportedInitialOptions(plugin: { setup: (b: any) => void }): boolean {\n  let safe = true\n  const probe = new Proxy({ platform: 'node', plugins: [] }, { get(t, p) { if (p in t) return (t as any)[p]; safe = false; return undefined } })\n  try { plugin.setup({ initialOptions: probe } as any) } catch { /* ignore setup errors */ }\n  return safe\n}","tryCatchPattern":"try {\n  await build()\n} catch (e) {\n  if (e instanceof Error && e.message === 'Not implemented') {\n    console.error('An esbuild plugin reads an unsupported initialOptions key; migrate it to rolldown.')\n  }\n  throw e\n}","preventionTips":["Prefer rolldown-native plugins over adapted esbuild plugins in Vite config.","Static-audit third-party esbuild plugins for build.initialOptions access before registering them.","Pass configuration values through plugin options rather than reading initialOptions."],"tags":["optimizer","rolldown","esbuild-plugin","plugin-adapter"],"backgroundTag":null,"analyzedSha":"b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab","analyzedAt":"2026-08-11T11:49:19.515Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}