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 of in Vue's v-for directive crashes CLI with TS1005 #4136

Closed
brawaru opened this issue Jun 21, 2023 · 4 comments
Closed

Using of in Vue's v-for directive crashes CLI with TS1005 #4136

brawaru opened this issue Jun 21, 2023 · 4 comments
Labels

Comments

@brawaru
Copy link

brawaru commented Jun 21, 2023

Which package?

@formatjs/cli@6.1.3

Describe the bug

CLI crashes when it encounters Vue's v-for directive that uses of rather than in, spitting the following message into console:

Error: src/App.vue:1:10 - error TS1005: ')' expected.

1 (message of messages)
           ~~
src/App.vue:1:13 - error TS1434: Unexpected keyword or identifier.

1 (message of messages)
              ~~~~~~~~
src/App.vue:1:21 - error TS1128: Declaration or statement expected.

1 (message of messages)

To Reproduce

Codesandbox URL

https://stackblitz.com/edit/vitejs-vite-fh4o89?file=src%2FApp.vue

Reproducible Steps/Repo

Steps to reproduce the behavior:

  1. Write v-for condition that uses of instead of in (both mean the same thing in Vue):
    <div v-for="message of messages" v-key="message.id" class="message">
      {{ message.content }}
    </div>
  2. Run CLI (through pnpm intl:extract in the playground above)

Expected behavior

Extraction should work as usual.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: N/A
  • Browser: N/A
  • Version: N/A

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser: N/A
  • Version: N/A

Additional context

You can also use of as the delimiter instead of in, so that it is closer to JavaScript's syntax for iterators

https://vuejs.org/guide/essentials/list.html#v-for

@brawaru brawaru added the bug label Jun 21, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Jul 22, 2023
@brawaru

This comment was marked as outdated.

@github-actions github-actions bot removed the Stale label Jul 23, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Aug 23, 2023
@brawaru
Copy link
Author

brawaru commented Aug 23, 2023

No new versions of @formatjs/cli have been published. This issue is still relevant.

@github-actions github-actions bot removed the Stale label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant