{"record":{"id":"b80a082ec21cc66b","repo":"cube-js/cube","slug":"link-linkname-on-dimension-dimname-confl","errorCode":null,"errorMessage":"Link '${linkName}' on dimension '${dimName}' conflicts with existing dimension '${syntheticName}'","messagePattern":"Link '(.+?)' on dimension '(.+?)' conflicts with existing dimension '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-schema-compiler/src/compiler/CubeSymbols.ts","lineNumber":674,"sourceCode":"          }\n        }\n      }\n    }\n  }\n\n  protected generateSyntheticLinkDimensions(cube: any) {\n    if (!cube.dimensions) return;\n\n    const dims = cube.dimensions;\n    for (const dimName of Object.keys(dims)) {\n      const dimDef = dims[dimName];\n      if (dimDef.links && Array.isArray(dimDef.links)) {\n        for (const link of dimDef.links) {\n          const linkName = typeof link.name === 'function' ? link.name() : link.name;\n          if (!linkName) return;\n          const syntheticName = `${dimName}___link_${linkName}_url`;\n          if (dims[syntheticName] && !dims[syntheticName].synthetic) {\n            throw new Error(`Link '${linkName}' on dimension '${dimName}' conflicts with existing dimension '${syntheticName}'`);\n          }\n          if (!dims[syntheticName]) {\n            let baseSql;\n            if (link.url) {\n              baseSql = link.url;\n            } else if (link.dashboard) {\n              const dashboardId = link.dashboard;\n              const escaped = dashboardId.replace(/'/g, \"''\");\n              // eslint-disable-next-line no-new-func\n              baseSql = new Function(`return \\`'/dashboard/${escaped}'\\``);\n            }\n            if (baseSql) {\n              const sql = this.buildLinkSqlWithParams(cube.name, baseSql, link.params || []);\n              dims[syntheticName] = {\n                sql,\n                type: 'string',\n                synthetic: true,\n                public: dimDef.public !== false,","sourceCodeStart":656,"sourceCodeEnd":692,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-schema-compiler/src/compiler/CubeSymbols.ts#L656-L692","documentation":"While generating the synthetic URL dimension for a dimension link (named <dimension>___link_<link>_url), the compiler found a non-synthetic dimension already occupying that name in the same cube. The collision happens because the manually declared dimension was not marked with synthetic: true, so the compiler refuses to overwrite it.","triggerScenarios":"Thrown at packages/cubejs-schema-compiler/src/compiler/CubeSymbols.ts:674 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the manually declared dimension so it does not collide with the generated <dimension>___link_<link>_url name","Mark the existing dimension as synthetic: true if it is meant to be the link dimension","Rename the link or the parent dimension to change the generated synthetic name"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}