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

Problems with parsing TSX #423

Open
4 tasks done
cernymatej opened this issue Dec 6, 2024 · 2 comments
Open
4 tasks done

Problems with parsing TSX #423

cernymatej opened this issue Dec 6, 2024 · 2 comments

Comments

@cernymatej
Copy link

Reporting a bug?

As reported in #402, there are some problems with parsing the TSX template and I believe they were not fixed by #414.

Specifically, the following error appears in the console when trying to run the dev server: Pre-transform error: '>' expected.

IMPORTANT: this doesn't show up in the reproduction on Stackblitz, because it is masked by #420, however, when you download it and run it locally, you can see the error. (at least on my machine - check system info)

Expected behavior

No error should appear and the app should build successfully

Reproduction

https://stackblitz.com/edit/github-ffpcjt-wvpad2?file=package.json

Issue Package

vite-plugin-vue-i18n

System Info

System:
    OS: macOS 15.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 5.24 GB / 96.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
    pnpm: 9.9.0 - ~/Library/pnpm/pnpm
    bun: 1.0.25 - ~/.bun/bin/bun
  Browsers:
    Chrome: 130.0.6723.116
    Safari: 18.1

Screenshot

image

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Read the README
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.
@cernymatej cernymatej added the Status: Review Needed Request for review comments label Dec 6, 2024
@kazupon
Copy link
Member

kazupon commented Dec 8, 2024

Thank you for your reporting!

Unfortunately, This issue caused by v-t directive optimization. Nuxt i18n optimize with using vue-i18n-extensions, which has still issue for tsx. 😞

v-t is supported by vue-i18n, but this directive is scheduled to be deprecated in vue-i18n v12.
In anticipation of this, nuxt i18n has added an option that allows you to opt out in v9.1.1.
You can avoid this by setting the following in nuxt.config.ts.

i18n: {
  bundle: {
    optimizeTranslationDirective: false
  }
}

@kazupon kazupon added has workaround and removed Status: Review Needed Request for review comments labels Dec 8, 2024
@cernymatej
Copy link
Author

cernymatej commented Dec 8, 2024

Thank you! ❤️ I can finally update to nuxt-i18n v9 🥳

So, it is probably not worth fixing it if it's going to be removed, correct?
I'll add information about this into the issue in nuxt-i18n as well.)

Feel free to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants