Skip to content

v-else used on element <td> without corresponding v-if #143

Closed
@adamshaylor

Description

@adamshaylor
  1. npm init on an empty directory.
  2. Follow the Parcel 2 instructions for creating a Vue project.
  3. npm i --save @coreui/vue@3.2.9
  4. Add Vue.use(CoreuiVue); from @coreui/vue/src per the pro admin template.
  5. npm run dev

Expected

The project should compile without error.

Saw

🚨  /[path to project]/node_modules/@coreui/vue/src/components/table/CDataTable.vue: v-else used on element <td> without corresponding v-if.
    at VueAsset.compileTemplate (/[path to project]/node_modules/parcel-bundler/src/assets/VueAsset.js:152:15)
    at VueAsset.postProcess (/[path to project]/node_modules/parcel-bundler/src/assets/VueAsset.js:100:26)
    at Pipeline.processAsset (/[path to project]/node_modules/parcel-bundler/src/Pipeline.js:90:31)
    at async Pipeline.process (/[path to project]/node_modules/parcel-bundler/src/Pipeline.js:24:23)
    at async Object.run (/[path to project]/node_modules/parcel-bundler/src/worker.js:15:12)
    at async Child.handleRequest (/[path to project]/node_modules/@parcel/workers/src/child.js:60:26)

The only reason I can think of for the discrepancy between Parcel and Vue CLI behavior that came with the template is that the error Parcel is choking on is technically only warning. Whether we consider it an warning or an outright error, it’s:

  1. Breaking Parcel.
  2. Not great code because the v-else is not on a matching element type.
  3. Easily remedied by using another v-if with a negated version of the same condition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions