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

Unexpected token '<' in json files with html tags #132

Open
4 tasks done
ssuess opened this issue Jul 4, 2022 · 1 comment
Open
4 tasks done

Unexpected token '<' in json files with html tags #132

ssuess opened this issue Jul 4, 2022 · 1 comment

Comments

@ssuess
Copy link

ssuess commented Jul 4, 2022

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

#131

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.
@ssuess ssuess added the Status: Review Needed Request for review comments label Jul 4, 2022
@ssuess ssuess changed the title Unexpected token '<' in json files with html values Unexpected token '<' in json files with html tags Jul 4, 2022
@ssuess
Copy link
Author

ssuess commented Jul 4, 2022

hm, upon further inspection, this may be a duplicate of #124

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