bundle-tools icon indicating copy to clipboard operation
bundle-tools copied to clipboard

Unexpected token '<' in json files with html tags

Open ssuess opened this issue 2 years ago • 1 comments

Reporting a bug?

Getting this error:

 [vite] Internal server error: Unexpected token '<'.
  Plugin: vite-plugin-vue-i18

only in files which have html in the values (ie: {"en-GB":{"description":"<p><em>This</em> shows...</p>"}}). All other files work just fine.

Expected behavior

As with webpack, that html tags inside of language json files would work.

Reproduction

import any json file using the i18n template block like so:

<i18n src="../i18n-compiled/myfile.json"></i18n>

Issue Package

vite-plugin-vue-i18n

System Info

System:
    OS: macOS 12.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 3.02 GB / 40.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.15.1/bin/yarn
    npm: 8.13.2 - ~/.nvm/versions/node/v16.15.1/bin/npm
  Browsers:
    Brave Browser: 97.1.34.81
    Chrome: 103.0.5060.53
    Firefox: 101.0.1
    Safari: 15.5
  npmPackages:
    @intlify/vite-plugin-vue-i18n: ^3.3.1 => 3.4.0
    vue: ^3.0.0 => 3.2.37
    vue-i18n: ^9.0.0 => 9.1.10

Screenshot

No response

Additional context

https://github.com/intlify/bundle-tools/discussions/131

Validations

  • [X] Read the Contributing Guidelines.
  • [X] Read the README
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion.

ssuess avatar Jul 04 '22 05:07 ssuess

hm, upon further inspection, this may be a duplicate of https://github.com/intlify/bundle-tools/issues/124

ssuess avatar Jul 04 '22 05:07 ssuess