intlify / bundle-tools

bundling for intlify i18n tools
MIT License
239 stars 37 forks source link

[vue-facing-decorator][vue-3][vue-i18n@9] bug to load local i18n bloc #268

Closed rdhainaut closed 1 year ago

rdhainaut commented 1 year ago

Reporting a bug?

I'm unable to use the custom block in Single File Components (SFC) in a project that employs vue-facing-decorator, Vue 3, and Vite. The local translations are missing, with all i18n methods displaying the key instead of the expected message.

Expected behavior

Load messages from the i18n block and display them when used in the template.

Reproduction

repo with issue: https://github.com/rdhainaut/vue3-vfd-i18n-issue

WARNING: This project utilizes class-based components along with vue-facing-decorator. This is now the official recommendation for upgrading from Vue 2 class components/property decorators to Vue 3.

The issue arises only when using the recommended setting with reflect-metadata to set up the alias for vue-facing-decorator. config: https://github.com/rdhainaut/vue3-vfd-i18n-issue/blob/master/vite.config.ts line: 18 doc: https://facing-dev.github.io/vue-facing-decorator/#/en/compatibility/reflect-metadata/reflect-metadata

Issue Package

unplugin-vue-i18n

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz
    Memory: 44.39 GB / 63.67 GB
  Binaries:
    Node: 18.12.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.1485.0)

Screenshot

No response

Additional context

No response

Validations

rdhainaut commented 1 year ago

Edit: I have identified the root cause of the issue and submitted a fix via a Pull Request (PR). More details can be found here: https://github.com/intlify/bundle-tools/pull/269/commits/2723a290f6484f8ecbfc6288c6eff376fb27a640

kazupon commented 1 year ago

Fixed in #269 Thanks!