Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotate: Not sure where the SFC parse error occurred #36

Open
3 tasks done
kazupon opened this issue Oct 20, 2021 · 0 comments
Open
3 tasks done

annotate: Not sure where the SFC parse error occurred #36

kazupon opened this issue Oct 20, 2021 · 0 comments
Labels
Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments Type: Improvement Includes backwards-compatible fixes

Comments

@kazupon
Copy link
Member

kazupon commented Oct 20, 2021

Clear and concise description of the problem

Currently, when an error occurs in SFC parse, an error with the following stack trace is output:

SyntaxError: SFC parse error
    at Object.annotate (/path/to/ode_modules/@intlify/cli/lib/chunks/annotate.cjs:202:19)
    at Object.handler (/path/to/ode_modules/@intlify/cli/lib/cli.cjs:195:30) {
  erorrs: [
    SyntaxError: Element is missing end tag.
        at createCompilerError (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:19:19)
        at emitError (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1599:29)
        at parseElement (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1152:9)
        at parseChildren (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:943:28)
        at parseElement (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1131:22)
        at parseChildren (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:943:28)
        at parseElement (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1131:22)
        at parseChildren (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:943:28)
        at parseElement (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1131:22)
        at parseChildren (/path/to/ode_modules/@vue/compiler-core/dist/compiler-core.cjs.js:943:28) {
      code: 24,
      loc: [Object]
    }
  ],
  filepath: '/path/to/src/apps/custom_tag/CustomTagView.vue'
}

We don’t know the location that is occured .vue file.

Suggested solution

We should output the location as well, as shown below:

SyntaxError: SFC parse error
    at Object.annotate (/path/to/ode_modules/@intlify/cli/lib/chunks/annotate.cjs:202:19)
    at Object.handler (/path/to/ode_modules/@intlify/cli/lib/cli.cjs:195:30) {
  erorrs: [
    SyntaxError: Element is missing end tag.
      code: 24,
      loc: {
	line: 1,
	column: 1
      }
    }
  ],
  filepath: '/path/to/src/apps/custom_tag/CustomTagView.vue'
}

Alternative

No response

Additional context

No response

Validations

@kazupon kazupon added Status: Proposal Request for comments Status: PR Welcome Welcome to Pull Request Type: Improvement Includes backwards-compatible fixes labels Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments Type: Improvement Includes backwards-compatible fixes
Projects
None yet
Development

No branches or pull requests

1 participant