{"record":{"id":"8494b592565497b3","repo":"Meituan-Dianping/mpvue","slug":"text-children-i-text-trim-between-v-if-and-8494b5","errorCode":null,"errorMessage":"text \"${children[i].text.trim()}\" between v-if and v-else(-if) will be ignored.","messagePattern":"text \"(.+?)\" between v-if and v-else\\(-if\\) will be ignored\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/compiler/parser/index.js","lineNumber":396,"sourceCode":"      exp: el.elseif,\n      block: el\n    })\n  } else if (process.env.NODE_ENV !== 'production') {\n    warn(\n      `v-${el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else'} ` +\n      `used on element <${el.tag}> without corresponding v-if.`\n    )\n  }\n}\n\nfunction findPrevElement (children: Array<any>): ASTElement | void {\n  let i = children.length\n  while (i--) {\n    if (children[i].type === 1) {\n      return children[i]\n    } else {\n      if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {\n        warn(\n          `text \"${children[i].text.trim()}\" between v-if and v-else(-if) ` +\n          `will be ignored.`\n        )\n      }\n      children.pop()\n    }\n  }\n}\n\nfunction addIfCondition (el, condition) {\n  if (!el.ifConditions) {\n    el.ifConditions = []\n  }\n  el.ifConditions.push(condition)\n}\n\nfunction processOnce (el) {\n  const once = getAndRemoveAttr(el, 'v-once')","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/compiler/parser/index.js#L378-L414","documentation":"Dev-only warning from findPrevElement while resolving v-if/v-else chains: non-element nodes (text/interpolation) exist between a v-if element and its v-else/v-else-if sibling. The compiler still links the chain but discards that text, so content silently disappears from output.","triggerScenarios":"Thrown at src/compiler/parser/index.js:396 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the text between the v-if and v-else(-if) elements","Move the text inside one of the conditional branches"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}