{"record":{"id":"3a6c7782f12583ab","repo":"abhigyanpatwari/GitNexus","slug":"missing-message-for-missing-local-embedding-stack-packages","errorCode":null,"errorMessage":"missing (message for missing local embedding stack packages)","messagePattern":"missing \\(message for missing local embedding stack packages\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/embeddings/embedding-local-init.ts","lineNumber":87,"sourceCode":"  }\n\n  const finalConfig = resolveEmbeddingConfig(config);\n  const gpuDevice: EmbeddingSidecarDevice = isEffectiveCudaAvailable()\n    ? 'cuda'\n    : process.platform === 'win32'\n      ? 'dml'\n      : 'cpu';\n  const requestedDevice =\n    forceDevice || (finalConfig.device === 'auto' ? gpuDevice : finalConfig.device);\n\n  initPromise = (async () => {\n    try {\n      ensureEmbeddingStackResolvable();\n      ensureOnnxRuntimeCommonResolvable();\n      ensureOnnxRuntimeNodeMatchesSystem();\n      const { pipeline, env } = await import('@huggingface/transformers').catch((err: unknown) => {\n        const missing = getMissingLocalEmbeddingStackMessage(err);\n        if (missing) throw new Error(missing);\n        throw err;\n      });\n\n      env.allowLocalModels = false;\n      applyHfEnvOverrides(env);\n\n      const isDev = process.env.NODE_ENV === 'development';\n      if (isDev) {\n        logger.info(`🧠 Loading embedding model: ${finalConfig.modelId}`);\n      }\n\n      const progressCallback = onProgress\n        ? (data: ProgressInfo) => {\n            const progress: ModelProgress = {\n              status:\n                data.status === 'progress_total'\n                  ? 'progress'\n                  : ((data.status as ModelProgress['status']) ?? 'progress'),","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/core/embeddings/embedding-local-init.ts#L69-L105","documentation":"initLocalEmbedder converts an ERR_MODULE_NOT_FOUND / MODULE_NOT_FOUND failure from the dynamic import of @huggingface/transformers into the actionable missing-stack message from getMissingLocalEmbeddingStackMessage(). The default gitnexus npm install no longer ships the optional embedding packages, so importing them fails until the runtime prefix is installed. Unrelated module-not-found errors inside transformers.js are re-thrown unchanged.","triggerScenarios":"Calling initLocalEmbedder() when the local embedding stack is not installed (resolveEmbeddingRuntime found no prefix and the packages are absent from node_modules) and ensureEmbeddingStackResolvable/ensureOnnxRuntime* checks let a missing-specifier import() through, or the import itself fails with the package name in the error.","commonSituations":"Fresh `npm install gitnexus` without running `gitnexus embeddings install`; upgrading from 1.6.12 where packages were inlined and are now pruned; GITNEXUS_EMBEDDING_RUNTIME_DIR pointing at an empty/unpopulated directory.","solutions":["Run `gitnexus embeddings install` — fetches the stack into ~/.gitnexus/embedding-runtime (or GITNEXUS_EMBEDDING_RUNTIME_DIR).","On CUDA hosts add --cuda (and set GLOBAL_AGENT_HTTPS_PROXY behind a proxy) for the NuGet download.","If a leftover 1.6.12 package-first tree exists, do a clean reinstall of gitnexus; --force only refreshes prefix overrides.","Alternatively set GITNEXUS_EMBEDDING_URL + GITNEXUS_EMBEDDING_MODEL to embed over HTTP without the local stack."],"exampleFix":"// before: import fails, stack pruned by default\nconst embedder = await initLocalEmbedder();\n// after (shell)\ngitnexus embeddings install && node -e \"import('...').then(m => m.initLocalEmbedder())\"","handlingStrategy":"try-catch","validationCode":"import { resolveEmbeddingRuntime, assessLocalEmbeddingRuntime } from 'gitnexus/src/core/embeddings/runtime-support.js';\nif (assessLocalEmbeddingRuntime().status === 'needs-install') {\n  console.log('Run `gitnexus embeddings install` first');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await initLocalEmbedder();\n} catch (err) {\n  if (isMissingLocalEmbeddingStackMessage(err.message)) {\n    // instruct: gitnexus embeddings install, or fall back to GITNEXUS_EMBEDDING_URL\n  } else throw err;\n}","preventionTips":["Run `gitnexus embeddings install` right after installing/upgrading gitnexus","Do a clean reinstall when migrating from 1.6.12 package-first trees","Ensure GITNEXUS_EMBEDDING_RUNTIME_DIR (if set) points at a populated runtime"],"tags":["embedding","missing-dependency","module-not-found","installation"],"backgroundTag":"missing-optional-dependency","analyzedSha":"ac9a4e9abd8fd3058c070b72c23402a4f887929a","analyzedAt":"2026-09-15T23:29:44.066Z","contentChangedAt":"2026-09-15T23:29:44.066Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}