{"record":{"id":"129a423c20c238d3","repo":"vitejs/vite","slug":"not-implemented-property-prop","errorCode":null,"errorMessage":"Not implemented property: ${prop}","messagePattern":"Not implemented property: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vite/src/node/optimizer/pluginConverter.ts","lineNumber":149,"sourceCode":"      }\n\n      for (const cb of onStartCallbacks) {\n        cb()\n      }\n    },\n    generateBundle(_outputOpts, _bundle, isWrite) {\n      const buildResult = new Proxy(\n        {\n          metafile: undefined,\n          mangleCache: undefined,\n          ...(isWrite ? { outputFiles: undefined } : {}),\n        } as esbuild.BuildResult,\n        {\n          get(_target, prop) {\n            if (prop in _target || typeof prop === 'symbol') {\n              return (_target as any)[prop]\n            }\n            throw new Error('Not implemented property: ' + prop)\n          },\n        },\n      )\n      for (const cb of onEndCallbacks) {\n        cb(buildResult)\n      }\n    },\n    async resolveId(id, importer, opts) {\n      for (const handler of resolveIdHandlers) {\n        const result = await handler.call(this, id, importer, opts)\n        if (result) {\n          if (typeof result === 'object' && result.namespace) {\n            usedNamespaces.add(result.namespace)\n          }\n          return result\n        }\n      }\n      if (usedNamespaces.size) {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/vitejs/vite/blob/b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab/packages/vite/src/node/optimizer/pluginConverter.ts#L131-L167","documentation":"Thrown from the `buildResult` Proxy in `generateBundle` (pluginConverter.ts:149). The converter exposes only `metafile`, `mangleCache`, and (in write mode) `outputFiles` on the synthesized esbuild BuildResult; accessing any other string property throws. This guards esbuild onEnd callbacks from relying on unsupported BuildResult fields.","triggerScenarios":"An esbuild plugin's `onEnd(result)` callback reads `result.<unsupportedProp>` (e.g. `result.warnings`, `result.errors`, `result.replay`, `result.toString`). The proxy get trap throws `Not implemented property: <prop>`.","commonSituations":"Plugins that inspect build output metadata beyond metafile/outputFiles in onEnd. Plugins ported from esbuild expecting warnings/errors arrays on the result. Plugins reading `result.outputFiles` in non-write (generate) mode, which the proxy omits.","solutions":["Read only `result.metafile`, `result.mangleCache`, or `result.outputFiles` (write mode) from onEnd.","Collect warnings/errors via onStart/onEnd with your own accumulator inside onResolve/onLoad instead of from the result.","Switch to a rolldown-native plugin using rolldown's bundle/output hooks for richer result data.","If you need output content in non-write mode, switch the build to write mode or use rolldown's `generate` API directly."],"exampleFix":"// before\nbuild.onEnd((result) => {\n  for (const w of result.warnings) console.warn(w.text)\n})\n\n// after\nconst warnings = []\nbuild.onResolve({ filter: /.*/ }, (args) => { /* push warnings */ })\nbuild.onEnd(() => { for (const w of warnings) console.warn(w) })","handlingStrategy":"validation","validationCode":"const SUPPORTED_RESULT = new Set(['metafile', 'mangleCache', 'outputFiles'])\nfunction assertOnEndSafe(plugin: { setup: (b: any) => void }) {\n  const probe: any = new Proxy({ metafile: undefined, mangleCache: undefined, outputFiles: undefined }, {\n    get(t, p) { if (SUPPORTED_RESULT.has(p as string) || typeof p === 'symbol') return (t as any)[p]; throw new Error(`onEnd reads unsupported result.${String(p)}`) },\n  })\n  plugin.setup({ onStart() {}, onEnd(cb: (r: any) => void) { cb(probe) }, onResolve() {}, onLoad() {}, onDispose() {}, initialOptions: {}, resolve() {} } as any)\n}\n// assertOnEndSafe(myEsbuildPlugin) before registering","typeGuard":"function onEndReadsSupportedOnly(plugin: { setup: (b: any) => void }): boolean {\n  let ok = true\n  const probe = new Proxy({ metafile: undefined, mangleCache: undefined, outputFiles: undefined }, { get(t, p) { if (p in t || typeof p === 'symbol') return (t as any)[p]; ok = false; return undefined } })\n  try { plugin.setup({ onEnd: (cb: (r: any) => void) => cb(probe), onResolve() {}, onLoad() {}, onStart() {}, onDispose() {}, initialOptions: {}, resolve() {} } as any) } catch { /* ignore */ }\n  return ok\n}","tryCatchPattern":"try {\n  await build()\n} catch (e) {\n  if (e instanceof Error && /Not implemented property:/.test(e.message)) {\n    const prop = e.message.split('Not implemented property:')[1]\n    console.error(`onEnd callback reads unsupported BuildResult.${prop}; use metafile/outputFiles only.`)\n  }\n  throw e\n}","preventionTips":["Restrict onEnd result reads to metafile, mangleCache, and outputFiles (write mode).","Accumulate warnings/errors yourself via onResolve/onLoad instead of relying on BuildResult arrays.","Migrate to rolldown-native hooks for richer build result introspection."],"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"}