Comments (17)
For me the following config solved the issue:
export default defineNuxtConfig({
i18n: {
compilation: {
strictMessage: false,
},
},
})
The right config key is compilation
and not precompile
-> https://v8.i18n.nuxtjs.org/options/misc
from bundle-tools.
Thank you for your reporting!
You need to configure
strictMessage: false
. Please see the option at here: https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#strictmessage
I should mention that if you're using nuxt-i18n
then you should add this to i18n
option in nuxt.config.ts
:
precompile: {
strictMessage: false,
}
from bundle-tools.
Thank you for your reporting!
You need to configure strictMessage: false
.
Please see the option at here:
https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#strictmessage
from bundle-tools.
I add strictMessage: false in createI18n and in my nuxt.config.ts but in both cases I get same error
I use vue-i18n and nuxt 3.4.1
So you have it like this, right?
export default defineNuxtConfig({
i18n: {
precompile: {
strictMessage: false,
},
},
})
from bundle-tools.
I'm using the latest version of the tool and nuxt 3.6.5 and if I have:
compilation: {
strictMessage: false,
},
I don't see anymore the error message, but the HTML tag gets printed ( all I want to do is to add a "<br>" tag for formatting my text, I actually see "<br>" printed out ). What's the solution here ?
escapeHtml: true or false simply changes how the tag is printed out to screen.
from bundle-tools.
I added it a little differently, but I did it now the way you wrote, unfortunately the same error in html.
Following the logical path that you suggested, I added it like this and it works)
p.s. this is setting add in nuxt.config.ts
code:
vite: {
plugins: [
VueI18nVitePlugin({
strictMessage: false,
include: [
resolve(dirname(fileURLToPath(import.meta.url)), './locales/*.json')
]
})
],
},
from bundle-tools.
As per official nuxt/i18n docs:
If
strictMessage
is disabled by setting it to false, we recommend enablingescapeHtml
option.
Therefore, now it would be...
export default defineNuxtConfig({
i18n: {
compilation: {
strictMessage: false,
escapeHtml: true,
},
},
})
from bundle-tools.
I add
strictMessage: false in createI18n
and in my nuxt.config.ts
but in both cases I get same error
I use vue-i18n and nuxt 3.4.1
from bundle-tools.
uh, I did it, you can close the error, I hope we helped the same guys as me)
from bundle-tools.
I got the same error .
the project is with electron + vue3 + webpack enviroment . i use the @inilify/unplugin-vue-i18n/webpack, but it show error ERROR [unplugin-vue-i18n] Detected HTML in because i have html in json file. i try to add strictMessage in options ,but it show another error
from bundle-tools.
Я получил ту же ошибку. проект с электронной + vue3 + средой webpack. я использую @inilify/unplugin-vue-i18n/webpack, но он показывает ошибку ERROR [unplugin-vue-i18n] Detected HTML in, потому что у меня есть html в файле json. я пытаюсь добавить strictMessage в опции, но он показывает другую ошибку
It work for me:
i use another project:
"@intlify/unplugin-vue-i18n": "^0.10.0",
"vue": "^3.2.13",
"vite": "^4.2.2"
from bundle-tools.
from bundle-tools.
@lxt-ing
Check u include, change on array maybe
from bundle-tools.
Love you @lucasboh , work for me in nuxt "^3.6.5",
from bundle-tools.
Hi!
We need minmal reproduction.
vue-i18n and nuxt i18n has starter
- vue-i18n (bug report): https://github.com/intlify/vue-i18n-next/issues/new?assignees=&labels=Status%3A+Review+Needed&projects=&template=bug-report.yml
- nuxt-i18n (bug report): https://github.com/nuxt-modules/i18n/issues/new?assignees=&labels=pending+triage&projects=&template=bug-report.yml
We hope you would give us your minamal reproduction.
from bundle-tools.
I'm using the latest version of the tool and nuxt 3.6.5 and if I have:
compilation: { strictMessage: false, },
I don't see anymore the error message, but the HTML tag gets printed ( all I want to do is to add a "
" tag for formatting my text, I actually see "
" printed out ). What's the solution here ?escapeHtml: true or false simply changes how the tag is printed out to screen.
@belfortf You need to use v-html to render html element
from bundle-tools.
Для меня следующая конфигурация решила проблему:
export default defineNuxtConfig({ i18n: { compilation: { strictMessage: false, }, }, })
Правильный ключ конфигурации
compilation
и неprecompile
-> https://v8.i18n.nuxtjs.org/options/misc
hi, it helped me, thank you
from bundle-tools.
Related Issues (20)
- failed to load config vite.config.js HOT 1
- TS error unplugin-vue-i18n 0.12.3 in createI18n HOT 2
- Cannot read properties of undefined (reading 'length') HOT 3
- Improper parsing of linked messages with `-` after 0.12 HOT 2
- @intlify/unplugin-vue-i18n doesn't work with Nuxt 3.7 HOT 1
- Missing dependencies and missing MessageFunctionInternal definition HOT 1
- can not inclue js locale files HOT 2
- Changelog of unplugin-vue-i18n is not up to date HOT 3
- @intlify/unplugin-vue-i18n not support HMR with Static bundle importing HOT 1
- Dependency Dashboard
- Module parse failed: Unexpected token (1:0) when combined with html-webpack-plugin HOT 14
- Failed locale loading: Unexpected token 'const'. HOT 1
- Rollup 4 support HOT 1
- `onlyLocales` not working for SFC <i18n locale="xx">
- it is not installed using npm install HOT 1
- Webpack build does not work together with html-webpack-plugin HOT 2
- Using HTML in SFC results in parsing issue `Unexpected scalar at node end` HOT 2
- nuxt3国际化报错 HOT 1
- Missing compile function in SSR build
- Is it possible to make a linkage with i18n Ally HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bundle-tools.