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

Using class in a Vue template causes parsing error #145

Open
onlyjsmith opened this issue Aug 29, 2019 · 5 comments
Open

Using class in a Vue template causes parsing error #145

onlyjsmith opened this issue Aug 29, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@onlyjsmith
Copy link

Bug description

Including class on a template element (even commented-out) results in a parsing error, and file to be missing from output SVG.

[2019-08-29 06:10:00.902 +0000] ERROR: Error parsing <...>/src/views/Test.vue

To Reproduce

  1. Operating system: macOS 10.14.6
  2. Arkit version and CLI arguments: v1.6.2
  • arkit -e "node_modules" src/views
  1. Arkit config, if any was used: none

  2. Source code example, if it's possible:

src/views/Test.vue

FAIL

<template>
  <div class='thing'></div>
</template>

<script>
</script>

PASS

<template>
  <div></div>
</template>

<script>
</script>
@onlyjsmith onlyjsmith added the bug Something isn't working label Aug 29, 2019
@danivalls
Copy link

Any updates on this?

@clorichel
Copy link

Exact same scenario here: can't get any .vue file to be parsed if this file's template contains a class. An App.vue that is parsed without a problem:

<template>
  <div></div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';

@Component
export default class App extends Vue {}
</script>

An App.vue that can't be parsed (notice the only addition is class="whatever" on the template div):

<template>
  <div class="whatever"></div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';

@Component
export default class App extends Vue {}
</script>

Here is the LEVEL=info error detail:

[2020-04-17 09:43:20.696 +0000] WARN : Unexpected scenario where a(n) OpenBraceToken was not found.
    Error: Unexpected scenario where a(n) OpenBraceToken was not found.
        at getTokenEnd (/myproject/node_modules/ts-morph/dist/ts-morph.js:1109:23)
        at Function.getContainerBodyPos (/myproject/node_modules/ts-morph/dist/ts-morph.js:1101:20)
        at isStatementMemberOrPropertyHoldingSyntaxList (/myproject/node_modules/ts-morph/dist/ts-morph.js:1325:38)
        at Function.getCompilerChildren (/myproject/node_modules/ts-morph/dist/ts-morph.js:1309:13)
        at SyntaxList._getCompilerChildren (/myproject/node_modules/ts-morph/dist/ts-morph.js:3773:31)
        at SyntaxList._getCompilerChildrenFast (/myproject/node_modules/ts-morph/dist/ts-morph.js:3779:58)
        at SyntaxList._getChildrenInCacheIterator (/myproject/node_modules/ts-morph/dist/ts-morph.js:3111:31)
        at _getChildrenInCacheIterator.next (<anonymous>)
        at CompilerFactory.initializeNode (/myproject/node_modules/ts-morph/dist/ts-morph.js:18282:28)
        at /myproject/node_modules/ts-morph/dist/ts-morph.js:18249:28
[2020-04-17 09:43:20.718 +0000] ERROR: Error parsing /myproject/src/App.vue

@dyatko would you need help on this one, say a reproduction repo, or maybe I might try and figure out a failing test case? Please feel free to share any pointer anyways 🤗

Looking forward to get my WOW diagram ❤️

@jackyang9451
Copy link

Any updates on this?

@badihi
Copy link

badihi commented May 28, 2020

On this update any?!

@badihi
Copy link

badihi commented May 28, 2020

I could somehow workaround this problem, by some modifications:
badihi@335e27a

I'm not sure that this will be eligible to be merged to master, but at least can be used as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants