nuxt-modules / i18n

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

NuxtLinkLocale missing default slots props #2823

Open userquin opened 7 months ago

userquin commented 7 months ago

Environment

Nuxt project info:                                                                                                                                     13:42:46

------------------------------
- Operating System: Windows_NT
- Node Version:     v20.10.0
- Nuxt Version:     3.10.3
- CLI Version:      3.10.1
- Nitro Version:    2.8.1
- Package Manager:  pnpm@8.15.3
- Builder:          -
- User Config:      typescript, modules, vue, macros, devtools, features, experimental, css, alias, imports, vite, postcss, appConfig, runtimeConfig, routeRules,
 nitro, sourcemap, hooks, app, security, colorMode, i18n, pwa, staleDep, unlazy
- Runtime Modules:  @vueuse/nuxt@10.8.0, @unocss/nuxt@0.58.5, @pinia/nuxt@0.5.1, @vue-macros/nuxt@1.6.0, @nuxtjs/i18n@8.1.1, @nuxtjs/color-mode@3.3.2, @unlazy/nu
xt@0.11.1, @nuxt/test-utils/module@3.11.0, ~/modules/emoji-mart-translation, ~/modules/purge-comments, ~/modules/build-env, ~/modules/tauri/index, ~/modules/pwa/
index, stale-dep/nuxt
- Build Modules:    -
------------------------------

Reproduction

NuxtLinkLocale rendering default slot without props: https://github.com/nuxt-modules/i18n/blob/main/src/runtime/components/NuxtLinkLocale.ts#L81

NuxtLink rendering default slot with props: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/components/nuxt-link.ts#L362

Example in elk.zone repo: https://github.com/elk-zone/elk/blob/95e466146d3b92ec212b725b0379a04a2eeeb6de/components/account/AccountPostsFollowers.vue#L14-L28

Describe the bug

When using NuxtLinkLocale with default slot props we get errors about missing props (trying to use NuxtLinkLocale in elk.zone):

Additional context

No response

Logs

imagen

imagen

github-actions[bot] commented 4 days 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)