{"record":{"id":"5c82885783eb8b76","repo":"apache/echarts","slug":"axispointer-exists","errorCode":null,"errorMessage":"axisPointer {} exists","messagePattern":"axisPointer (.+?) exists","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/component/axis/AxisView.ts","lineNumber":115,"sourceCode":"        if (!Clazz) {\n            return;\n        }\n        const axisPointerModel = axisPointerModelHelper.getAxisPointerModel(axisModel);\n        axisPointerModel\n            ? (this._axisPointer || (this._axisPointer = new Clazz()))\n                .render(axisModel, axisPointerModel, api, forceRender)\n            : this._disposeAxisPointer(api);\n    }\n\n    private _disposeAxisPointer(api: ExtensionAPI) {\n        this._axisPointer && this._axisPointer.dispose(api);\n        this._axisPointer = null;\n    }\n\n    static registerAxisPointerClass(type: string, clazz: AxisPointerConstructor) {\n        if (__DEV__) {\n            if (axisPointerClazz[type]) {\n                throw new Error('axisPointer ' + type + ' exists');\n            }\n        }\n        axisPointerClazz[type] = clazz;\n    };\n\n    static getAxisPointerClass(type: string) {\n        return type && axisPointerClazz[type];\n    };\n\n}\n\nexport default AxisView;","sourceCodeStart":97,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/echarts/blob/30076aedcd7b7f65d8dd8e8d9ece46ce778133a3/src/component/axis/AxisView.ts#L97-L127","documentation":"DEV-only guard in AxisView.registerAxisPointerClass: axis pointer implementations live in a module-level registry keyed by type. Registering the same type string twice throws in dev to catch accidental double-registration. Stripped in production (second registration silently overwrites).","triggerScenarios":"Calling echarts.registerAxisPointerClass (or an internal equivalent) with a type name that is already registered; HMR/hot-reload re-executing registration code; a custom extension reusing a built-in type string like 'cross' or 'shadow'.","commonSituations":"Vite/webpack HMR re-running the registration module; custom axis-pointer extension colliding with a built-in type; double import of an extension.","solutions":["Use a unique, namespaced type string for custom axis pointers","Guard registration with a getAxisPointerClass(type) existence check first","Ensure the registration module is imported exactly once (avoid HMR double-eval)"],"exampleFix":"// before\nAxisView.registerAxisPointerClass('cross', MyCrossPointer); // 'cross' taken\n\n// after\nif (!AxisView.getAxisPointerClass('myCross')) {\n  AxisView.registerAxisPointerClass('myCross', MyCrossPointer);\n}","handlingStrategy":"validation","validationCode":"// before registering an axis pointer class, check existence:\nif (!AxisView.getAxisPointerClass(type)) {\n  AxisView.registerAxisPointerClass(type, Clazz);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the registry with getAxisPointerClass before registering","Use namespaced type strings for custom axis pointers","Guard against HMR double-execution of registration modules"],"tags":["axis-pointer","registry","dev-only","hmr"],"backgroundTag":null,"analyzedSha":"30076aedcd7b7f65d8dd8e8d9ece46ce778133a3","analyzedAt":"2026-08-12T12:42:28.134Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}