{"record":{"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/b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab/packages/vite/src/node/optimizer/pluginConverter.ts#L220-L256","documentation":"Thrown by the onResolve handler adapter (pluginConverter.ts:238) when the esbuild plugin's onResolve callback returns a result with non-empty `warnings`, non-empty `watchDirs`, or an empty/falsy `path`. The adapter only supports the happy path (errors-as-throw via AggregateError, a resolved path, external/sideEffects/namespace) and rejects the rest as unsupported.","triggerScenarios":"An adapted esbuild plugin's onResolve callback returns `{ warnings: [...], path: 'x' }` or `{ watchDirs: ['/extra'] }` or `{ path: '' }`. Any of these trips line 238.","commonSituations":"Esbuild plugins that emit warnings during resolution. Plugins that declare additional watch directories. Plugins returning an empty path to signal 'handled but no id'. Porting such plugins to Vite's rolldown optimizer.","solutions":["Do not return `warnings` from onResolve; log them yourself or convert to errors.","Do not return `watchDirs`; use `this.addWatchFile(...)` in a rolldown-native resolveId hook instead.","Always return a real `path` (or return undefined/null to decline resolution).","Migrate to a rolldown-native resolveId hook which supports these features directly."],"exampleFix":"// before\nbuild.onResolve({ filter: /.*/ }, () => ({\n  path: 'virtual:thing',\n  warnings: [{ text: 'legacy resolver used' }],\n}))\n\n// after\nbuild.onResolve({ filter: /.*/ }, () => ({ path: 'virtual:thing' }))","handlingStrategy":"validation","validationCode":"function assertOnResolveResultSafe(result: any) {\n  if (!result) return\n  if ((result.warnings?.length ?? 0) > 0) throw new Error('onResolve result.warnings unsupported')\n  if ((result.watchDirs?.length ?? 0) > 0) throw new Error('onResolve result.watchDirs unsupported')\n  if (!result.path) throw new Error('onResolve result.path missing')\n}\n// wrap the plugin's callback to validate its return value during local tests","typeGuard":"function isSupportedOnResolveResult(r: any): boolean {\n  return !!r && (!r.warnings || r.warnings.length === 0) && (!r.watchDirs || r.watchDirs.length === 0) && typeof r.path === 'string' && r.path.length > 0\n}","tryCatchPattern":"try {\n  await build()\n} catch (e) {\n  if (e instanceof Error && e.message === 'not implemented' && onResolveContext(e)) {\n    console.error('onResolve returned warnings/watchDirs/empty path; simplify the return value.')\n  }\n  throw e\n}","preventionTips":["Return only { path, external?, sideEffects?, namespace? } from onResolve in adapted plugins.","Surface warnings via console/log inside onResolve rather than the result array.","Use this.addWatchFile in rolldown-native resolveId instead of result.watchDirs."],"tags":["optimizer","rolldown","esbuild-plugin","resolver","plugin-adapter"],"backgroundTag":null,"analyzedSha":"b4d66fee14d970f45b8a6f3d7d6aee73ca9b88ab","analyzedAt":"2026-08-11T11:49:19.515Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}