parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.4k stars 2.26k forks source link

Parcel 2 Vue 3 SFC JS line numbers from top of .vue file, not top of script block #7401

Closed mjog closed 2 years ago

mjog commented 2 years ago

🐛 bug report

The line numbers for Vue 3 SFC JS errors are taken from the top of the file, not from the top of the script block.

E.g. this error, line 6 here:

Screenshot from 2021-12-03 19-51-10

Is actually in the script block of the SFC, not from the template block at the top of the file:

<template>
  <div class="card-list-container w-auto">
    <div class="btn-group btn-group-toggle d-flex flex-row flex-wrap flex-md-nowrap"
         data-toggle="buttons">
      <label v-for="item in items"
             class="card card-block btn btn-primary text-left p-0"
             @click="clickFixup">
...
</template>

<script>
export default {
  name: "card-list",
  props: ['name', 'items', 'value'],
  emits: ['update:value']
  methods: {

(note the missing comma after emits)

mjog@blanchefort:~/Projects/vee.net/planetary$ pnpm list
Legend: production dependency, optional only, dev only

Planetary@1.0 /home/mjog/Projects/vee.net/planetary

dependencies:
bootstrap 4.6.1
jquery 3.6.0
popper.js 1.16.1
vue 3.2.23
vue-router 4.0.12
vuex 4.0.2

devDependencies:
@fortawesome/fontawesome-free 5.15.4
@parcel/core 2.0.1
@parcel/transformer-sass 2.0.1
@parcel/transformer-vue 2.0.1
@vue/component-compiler-utils 3.3.0
cssnano 4.1.11
parcel 2.0.1
sass 1.44.0
github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.