i18n icon indicating copy to clipboard operation
i18n copied to clipboard

After updating nuxt and i18n versions, i18n strictMessage doesn't work.

Open yongho0605 opened this issue 1 year ago • 2 comments

Environment

Reproduction

https://stackblitz.com/edit/github-vzm2gj?file=package.json,locales%2Fko.json,locales%2Fen.json,nuxt.config.ts,app.vue

Describe the bug

I updated my production application libraries after a long time and got an error. The error I reported is that if you remove the
tags in the scope of each single file component, the application works fine.

##Conclusion

  • When I reproduced the error, I got the following error message 스크린샷 2024-05-13 오후 3 28 49

스크린샷 2024-05-13 오후 3 29 07

Before version

  • Nuxt Version: 3.6.1
  • nuxtI18n Version: 8.0.0-beta.13

Current nuxt config setting

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  experimental: {
    inlineSSRStyles: false
  },
  runtimeConfig: {
    public: {
      apiUrl: process.env.NUXT_PUBLIC_API_URL || 'https://admin.application.io/api',
      mediaUrl: process.env.NUXT_PUBLIC_MEDIA_URL || '/media'
    }
  },
  app: {
    rootId: 'application',
    buildAssetsDir: '/_static/',
    head: {
      title: 'application',
      meta: [
        { charset: 'utf-8' },
        { name: 'viewport', content: 'width=device-width, initial-scale=1' },
    }
  },
  build: {
    transpile: ['@heroicons/vue', 'gsap']
  },
  modules: ['@formkit/nuxt', '@nuxtjs/tailwindcss', '@nuxt/image', 'nuxt-lodash', '@nuxtjs/sitemap', '@nuxtjs/i18n'],
  sitemap: {
    url: 'https://www.application.io', 
    xsl: false,
    exclude: ['/inquiries/**']
  },
  i18n: {
    langDir: './locales',
    baseUrl: 'https://www.application.io',
    lazy: true,
    detectBrowserLanguage: {
      fallbackLocale: 'ko',
      cookieSecure: true
    },
    locales: [
      { code: 'ko', iso: 'ko-KR', file: 'ko.json', name: 'KOR' },
      { code: 'en', iso: 'en-US', file: 'en.json', name: 'ENG' }
    ],
    defaultLocale: 'ko',
    strategy: 'no_prefix',
    compilation: { strictMessage: false }
  },
  css: ['~/assets/main.css']
})

Updated package.json

{
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare",
    "lint": "eslint . --fix --ext .js,.vue",
    "prettier": "prettier . --write",
    "prepare": "husky install",
    "set-husky": "husky add .husky/pre-commit \"npm run lint-staged\"",
    "lint-staged": "lint-staged"
  },
  "devDependencies": {
    "@nuxt/image": "^1.4.0",
    "@nuxtjs/eslint-config-typescript": "^12.1.0",
    "@nuxtjs/i18n": "^8.3.1",
    "@nuxtjs/sitemap": "^5.1.2",
    "@nuxtjs/tailwindcss": "^6.1.3",
    "@tailwindcss/typography": "^0.5.8",
    "eslint": "^8.57.0",
    "eslint-config-prettier": "^9.1.0",
    "husky": "^8.0.3",
    "lint-staged": "^15.2.2",
    "nuxt": "^3.11.2",
    "nuxt-lodash": "^2.5.0",
    "prettier": "^3.2.5",
    "prettier-plugin-tailwindcss": "^0.5.11",
    "sass": "^1.64.2",
    "tailwindcss": "^3.3.2",
    "typescript": "^5.1.3"
  },
  "dependencies": {
    "@formkit/nuxt": "^1.2.2",
    "@formkit/pro": "^0.117.5",
    "@formkit/themes": "^1.2.2",
    "@formkit/validation": "^1.2.2",
    "@headlessui/vue": "^1.7.4",
    "@heroicons/vue": "^2.0.13",
    "gsap": "^3.11.3",
    "tailwind-scrollbar-hide": "^1.1.7",
    "vue3-carousel": "^0.2.8",
    "vue3-marquee": "^3.1.2"
  },
  "lint-staged": {
    "./**/*.{js,ts,vue}": [
      "eslint --fix",
      "prettier --write"
    ]
  }
}

Additional context

I don't know where the crash is happening.

Logs

No response

yongho0605 avatar May 13 '24 06:05 yongho0605

Thank you for your reporting!

Unfortunately, We could not reproduce your reproduction. 😞 Could you give us your minimal new reproduction? 🙏

kazupon avatar Jun 24 '24 05:06 kazupon

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 Reproduction starter (v8 and higher) 👉 Reproduction starter (edge)

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

github-actions[bot] avatar Jun 24 '24 05:06 github-actions[bot]

This issue is caused by devtools processing the html in the translation strings (see https://github.com/nuxt/devtools/issues/572).

You can add the following to nuxt.config.ts to prevent this from happening:

devtools: {
    enabled: true,
    componentInspector: false,
},

Closing this as there's not much we can do about it from our side.

BobbieGoede avatar Jul 31 '24 10:07 BobbieGoede

Same problem in v.9.5.3 I tried to add componentInspector: false and also tried to disabled devtools, but not works.

mrc-bsllt avatar Apr 26 '25 14:04 mrc-bsllt

@mrc-bsllt Could you open a new issue with a minimal reproduction? 🙏

BobbieGoede avatar Apr 26 '25 14:04 BobbieGoede

@BobbieGoede https://github.com/nuxt-modules/i18n/issues/3580

mrc-bsllt avatar Apr 26 '25 15:04 mrc-bsllt