fix: break circular dependency in config error utilities to prevent plugin loader crash
- Created src/shared/config-errors.ts to isolate config error state management - Removed function re-exports (getConfigLoadErrors, clearConfigLoadErrors) from main index.ts - Only ConfigLoadError type is re-exported from main module to avoid OpenCode calling it as a plugin - Updated auto-update-checker hook to import from shared/config-errors instead of main index - Fixes "TypeError: undefined is not an object" crash when OpenCode iterated through ALL exports and called clearConfigLoadErrors(input) which returned undefined 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -4,7 +4,7 @@ import { invalidatePackage } from "./cache"
|
||||
import { PACKAGE_NAME } from "./constants"
|
||||
import { log } from "../../shared/logger"
|
||||
import { getUserConfigPath } from "../../shared/config-path"
|
||||
import { getConfigLoadErrors, clearConfigLoadErrors } from "../../index"
|
||||
import { getConfigLoadErrors, clearConfigLoadErrors } from "../../shared/config-errors"
|
||||
import type { AutoUpdateCheckerOptions } from "./types"
|
||||
|
||||
export function createAutoUpdateCheckerHook(ctx: PluginInput, options: AutoUpdateCheckerOptions = {}) {
|
||||
|
||||
Reference in New Issue
Block a user