{"record":{"id":"4278b4ad48c9d574","repo":"janhq/jan","slug":"mlx-engine-not-found-4278b4","errorCode":null,"errorMessage":"MLX engine not found","messagePattern":"MLX engine not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"web-app/src/containers/dialogs/ImportMlxModelDialog.tsx","lineNumber":94,"sourceCode":"      (model) => model.id === modelName\n    )\n\n    if (modelExists) {\n      toast.error('Model already exists', {\n        description: `${modelName} already imported`,\n      })\n      return\n    }\n\n    setImporting(true)\n\n    try {\n      console.log('[MLX Import] Starting import:', { modelName, selectedPath })\n\n      // Get the MLX engine and call its import method\n      const engine = ExtensionManager.getInstance().getEngine('mlx')\n      if (!engine) {\n        throw new Error('MLX engine not found')\n      }\n\n      console.log('[MLX Import] Calling engine.import()...')\n      await engine.import(modelName, {\n        modelPath: selectedPath,\n      })\n      console.log('[MLX Import] Import completed')\n\n      toast.success('Model imported successfully', {\n        description: `${modelName} has been imported`,\n      })\n\n      // Reset form and close dialog\n      setSelectedPath(null)\n      setModelName('')\n      setOpen(false)\n      onSuccess?.(modelName)\n    } catch (error) {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/web-app/src/containers/dialogs/ImportMlxModelDialog.tsx#L76-L112","documentation":"Thrown in ImportMlxModelDialog.handleImport when ExtensionManager.getInstance().getEngine('mlx') returns nothing, so the dialog cannot invoke engine.import() on the selected local model folder. Indicates the MLX engine/extension is unavailable at import time.","triggerScenarios":"Selecting a local MLX model folder and clicking import while the 'mlx' engine is not registered — extension missing/disabled, failed initialization, or unsupported platform.","commonSituations":"The MLX extension was removed or never installed; the extension crashed on startup; importing a local folder before engines finish registering; running on hardware where MLX is unsupported.","solutions":["Enable/install the MLX extension under Settings > Extensions, then reopen the import dialog","Restart the app to force engine re-registration","Verify the platform supports MLX; otherwise use a different provider for the model","Check devtools console logs for MLX extension load errors before the import attempt"],"exampleFix":"// before\nconst engine = ExtensionManager.getInstance().getEngine('mlx')\nif (!engine) throw new Error('MLX engine not found')\n// after\nconst engine = ExtensionManager.getInstance().getEngine('mlx')\nif (!engine) {\n  setImportError('MLX engine unavailable. Install/enable the MLX extension and restart the app.')\n  return\n}","handlingStrategy":"type-guard","validationCode":"const engine = ExtensionManager.getInstance().getEngine('mlx')\nif (!engine || typeof engine.import !== 'function') {\n  setImportError('MLX extension unavailable. Enable it and restart the app.')\n  return\n}","typeGuard":"const hasMlxImport = (e: unknown): e is { import: (name: string, opts: unknown) => Promise<void> } =>\n  !!e && typeof (e as any).import === 'function'","tryCatchPattern":"try {\n  await engine.import(modelName, { modelPath: selectedPath })\n} catch (e) {\n  if (e.message === 'MLX engine not found') setImportError('Install/enable the MLX extension first.')\n  else setImportError(`Import failed: ${e.message}`)\n}","preventionTips":["Check engine availability before opening the import dialog","Prompt for extension installation when missing","Restart the app after installing the MLX extension","Keep the dialog disabled until engines finish registering"],"tags":["extension","engine","dependency"],"backgroundTag":"missing-dependency","analyzedSha":"7205d770c1e097c3daf35a911176410e93bc5564","analyzedAt":"2026-09-17T14:27:30.100Z","contentChangedAt":"2026-09-17T14:27:30.100Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}