intlify / intlify/bundle-tools

Unexpected token '<' in json files with html tags

Open
#132 1 comment 0 reactions 0 assignees View on GitHub
status: review needed
Dominant language
TypeScript
Stars
270
Forks
46
PR merge metrics
No merged PRs in 30d

Description

### 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":"

This shows...

"}}`). 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:
```

```

### Issue Package

vite-plugin-vue-i18n

### System Info

```shell
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](https://github.com/intlify/bundle-tools/blob/main/.github/contributing.md).
- [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](https://github.com/intlify/bundle-tools/discussions).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.