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

Updating from 8.5.5 to 9.0.0 causes build warning #3209

Closed
Tkkg1994 opened this issue Nov 6, 2024 · 8 comments · Fixed by #3214
Closed

Updating from 8.5.5 to 9.0.0 causes build warning #3209

Tkkg1994 opened this issue Nov 6, 2024 · 8 comments · Fixed by #3214

Comments

@Tkkg1994
Copy link

Tkkg1994 commented Nov 6, 2024

Environment


  • Operating System: Windows_NT
  • Node Version: v20.15.1
  • Nuxt Version: 3.14.159
  • CLI Version: 3.15.0
  • Nitro Version: 2.10.3
  • Package Manager: npm@10.9.0
  • Builder: -
  • User Config: default
  • Runtime Modules: @pinia/nuxt@0.7.0, @nuxtjs/tailwindcss@6.12.2, @nuxtjs/i18n@9.0.0, @nuxtjs/seo@2.0.0-rc.23, nuxt-headlessui@1.2.0, nuxt-vuefire@1.0.4, @nuxtjs/color-mode@3.5.2, @vee-validate/nuxt@4.14.6, @nuxt/eslint@0.6.1, pinia-plugin-persistedstate/nuxt, @unlok-co/nuxt-stripe@4.0.1, @samk-dev/nuxt-vcalendar@1.0.4, @nuxtjs/turnstile@0.9.11
  • Build Modules: -

Reproduction

  1. Nuxt Configuration: Use the following nuxt.config.ts setup for i18n:
    i18n: {
    locales: [
    { code: 'en', file: 'en.json' },
    { code: 'fr', file: 'fr.json' },
    { code: 'de', file: 'de.json' },
    { code: 'it', file: 'it.json' }
    ],
    defaultLocale: 'de',
    lazy: true
    }

  2. i18n Config File: Include the following i18n configuration in i18n.config.ts:
    export default defineI18nConfig(() => ({
    legacy: false,
    locale: 'de',
    fallbackLocale: 'en'
    }))

  3. Run the Build Command: Execute npm run build to compile the application.

  4. Observe the Warning: During the build process, the following warning appears multiple times

Describe the bug

When building my Nuxt application using npm run build, I encounter repeated warnings related to unplugin-vue-i18n:directive. The specific warning message reads:

[plugin unplugin-vue-i18n:directive] Sourcemap is likely to be incorrect: a plugin (unplugin-vue-i18n:directive) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help.

This warning appears multiple times throughout the build process and seems related to the recent upgrade to @nuxtjs/i18n version 9, which uses unplugin-vue-i18n. Despite following the v9 migration guide and adjusting configurations, the warning persists, indicating potential issues with sourcemap generation during file transformations by unplugin-vue-i18n.

Additional context

I'm not sure if this is an issue with the module or with the main upstream element.
If you need anything else like logs or any configs, please let me know. I am more than happy to help!

Logs

No response

@jeverduzco
Copy link

jeverduzco commented Nov 8, 2024

Same issue here.

[plugin unplugin-vue-i18n:directive] Sourcemap is likely to be incorrect: a plugin (unplugin-vue-i18n:directive) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help.

Reproduction link: https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-sic7wm

Reproduction command: npm run build

@Dylan0916
Copy link

same issue here.
In a clean Nuxt project, simply adding @nuxtjs/i18n in modules ("nuxt.config.ts") will cause this issue.

@userquin
Copy link
Collaborator

userquin commented Nov 9, 2024

/cc @BobbieGoede @kazupon We should add this here https://github.com/intlify/bundle-tools/blob/main/packages/unplugin-vue-i18n/src/core/directive.ts#L92:

return {
  code,
  map: { version: 3, mappings: '', sources: [] } as any,
}

@userquin
Copy link
Collaborator

userquin commented Nov 9, 2024

This should fix the issue: intlify/bundle-tools#413

@kazupon
Copy link
Collaborator

kazupon commented Nov 9, 2024

I've just released v5.3.0
please try to check it
https://github.com/intlify/bundle-tools/releases/tag/unplugin-vue-i18n%405.3.0

@Anton-Plagemann
Copy link

Hi @kazupon, @userquin,
seems like the warning has a real issue behind as I'm having issues with my Sentry (error reporting) sourcemaps setup after upgrading to @nuxtjs/i18n@9.0.0 from @nuxtjs/i18n@8.5.6.
After upgrading sentry isn't able to find the correct sourcemaps for an issue.
Image

This is happening with @nuxtjs/i18n@9.0.0 and @intlify/unplugin-vue-i18n@5.3.1 as well as @intlify/unplugin-vue-i18n@5.2.0 but not when using @nuxtjs/i18n@8.5.6.
I don't have enough knowledge about sourcemaps to see whats wrong exactly, but I'm happy to help if you have some troubleshooting steps for me 😊

@Tkkg1994
Copy link
Author

Hello dear @userquin

Fantastic. Just updated everything and..... no more warnings! Thank you very much for fixing it 💃

@Anton-Plagemann
I don't know if you want to create an own issue or what the problem is with yours. I'd like to close this one if that's fine with you

@userquin
Copy link
Collaborator

This issue should be closed when linked pr merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants