nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.65k stars 465 forks source link

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

Open yongho0605 opened 1 month ago

yongho0605 commented 1 month ago

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

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

Before version

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

kazupon commented 1 week ago

Thank you for your reporting!

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

github-actions[bot] commented 1 week ago

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)](https://stackblitz.com/fork/github/BobbieGoede/nuxt-i18n-starter/tree/v8) 👉 [Reproduction starter (edge)](https://stackblitz.com/fork/github/BobbieGoede/nuxt-i18n-starter/tree/edge) A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as **minimal** as possible. See more details [in our guide](https://nuxt.com/docs/community/reporting-bugs/#create-a-minimal-reproduction). You might also find these other articles interesting and/or helpful: - [The Importance of Reproductions](https://antfu.me/posts/why-reproductions-are-required) - [How to Generate a Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve)