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

unplugin-vue-i18n + Vue 2.7 results in vee-validate unable to load its own localizations #190

Closed
4 tasks done
Hawxy opened this issue Oct 3, 2022 · 2 comments · Fixed by #201
Closed
4 tasks done
Assignees

Comments

@Hawxy
Copy link

Hawxy commented Oct 3, 2022

Reporting a bug?

I'm attempting to get precompilation working with my Vue 2.7 + vue-i18n-bridge project due to CSP restrictions, however adding our lang directory to the include array results in a webpack error with vee-validate locales no longer able to be imported:

ERROR in ./node_modules/vee-validate/dist/locale/es.json 2:8
Module parse failed: Unexpected token (2:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| {
>   "code": "es",
|   "messages": {
|     "alpha": "El campo {_field_} solo debe contener letras",
 @ ./src/validation.js 3:0-50 7:2-4
 @ ./src/main.js 3:0-22

Expected behavior

The plugin doesn't impact json files it's not responsible for.

Reproduction

https://github.com/Hawxy/vue-i18n-bridge-vee-validate-reproduction

Issue Package

unplugin-vue-i18n

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 10.46 GB / 31.92 GB
  Binaries:
    Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.12.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.521.0), Chromium (105.0.1343.50)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vue: 2.7.10 => 2.7.10
    vue-i18n: ^8.27.2 => 8.27.2

Screenshot

No response

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.
@Hawxy Hawxy added the Status: Review Needed Request for review comments label Oct 3, 2022
Copy link
Member

kazupon commented Nov 13, 2022

Thank you for your reporting!
Sorry, my late reply.

The implementation of unplugin-vue-i18n for webpack was still incomplete.
I’ll try to fix this issue.

@kazupon kazupon added Type: Bug Bug or Bug fixes and removed Type: Bug Bug or Bug fixes Status: Review Needed Request for review comments labels Nov 13, 2022 — with Volta.net
@kazupon kazupon self-assigned this Nov 13, 2022
Copy link
Member

kazupon commented Nov 13, 2022

I've just released unplugin-vue-i18n v0.7.3
Please check it!
Thanks!

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

Successfully merging a pull request may close this issue.

2 participants