{"id":"01300483549e8913","repo":"vitejs/vite","slug":"not-implemented-013004","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":238,"sourceCode":"      kind:\n        importerWithoutNamespace === undefined\n          ? 'entry-point'\n          : opts.kind === 'new-url' || opts.kind === 'hot-accept'\n            ? 'dynamic-import'\n            : opts.kind,\n      pluginData: {},\n      with: {},\n    })\n    if (!result) return\n    if (result.errors && result.errors.length > 0) {\n      throw new AggregateError(result.errors)\n    }\n    if (\n      (result.warnings && result.warnings.length > 0) ||\n      (result.watchDirs && result.watchDirs.length > 0) ||\n      !result.path\n    ) {\n      throw new Error('not implemented')\n    }\n    for (const file of result.watchFiles ?? []) {\n      this.addWatchFile(file)\n    }\n\n    return {\n      id: result.namespace ? `${result.namespace}:${result.path}` : result.path,\n      external: result.external,\n      moduleSideEffects: result.sideEffects,\n      namespace: result.namespace,\n    }\n  }\n}\n\nfunction createLoadHandler(\n  options: esbuild.OnLoadOptions,\n  callback: EsbuildOnLoadCallback,\n): LoadHandler {","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/vitejs/vite/blob/89620f09afcfef6b35e7bb8660132ab5b4d0cd3b/packages/vite/src/node/optimizer/pluginConverter.ts#L220-L256","documentation":"In the converted onResolve handler, if the esbuild plugin's callback returns a result containing `warnings`, `watchDirs`, or an empty/falsy `path`, the converter throws 'not implemented' at pluginConverter.ts:238. Rolldown's resolve result doesn't carry esbuild warnings or watchDirs the same way, and a resolve without a `path` isn't meaningful, so these are rejected rather than silently dropped.","triggerScenarios":"An esbuild-format onResolve callback returns an object like `{ warnings: [...], path: '...' }` or `{ path: '', ... }` or `{ watchDirs: [...] }`.","commonSituations":"Plugins that emit resolve-time warnings; plugins that conditionally return empty paths to signal 'skip'; plugins returning watchDirs for rebuilds.","solutions":["Stop returning `warnings`/`watchDirs` from your onResolve callback; handle them outside the resolve result.","Ensure your onResolve callback returns either `undefined` (no match) or an object with a non-empty `path`/`external`.","Reimplement as a native rolldown `resolveId` hook using rolldown's result shape.","Remove the plugin from `optimizeDeps.esbuildOptions.plugins`."],"exampleFix":"// before\nonResolve({ filter }, (args) => ({ path: resolved, warnings: [{ text: 'x' }] }))\n\n// after\nonResolve({ filter }, (args) => ({ path: resolved }))","handlingStrategy":"validation","validationCode":"function assertResolveResultShape(plugin: any) {\n  // statically reject onResolve callbacks that return warnings/watchDirs or empty path\n  const src = plugin.setup.toString()\n  if (/onResolve/.test(src) && /(warnings|watchDirs)\\s*:/.test(src))\n    throw new Error('onResolve returns warnings/watchDirs — unsupported by Vite optimizer')\n}","typeGuard":"function isCleanResolveResult(r: any): boolean {\n  return r == null || (typeof r.path === 'string' && r.path.length > 0\n    && !(r.warnings?.length) && !(r.watchDirs?.length))\n}","tryCatchPattern":null,"preventionTips":["Return only { path, external?, namespace? } from esbuild onResolve in Vite.","Return undefined (not { path: '' }) to signal a non-match."],"tags":["optimizer","plugin","esbuild","rolldown","interop"],"analyzedSha":"89620f09afcfef6b35e7bb8660132ab5b4d0cd3b","analyzedAt":"2026-08-03T19:28:02.920Z","schemaVersion":2}