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

Argument of type '"share-p-slug"' is not assignable to parameter of type 'keyof RouteNamedMap | undefined' #3230

Closed
lxccc812 opened this issue Nov 14, 2024 · 1 comment

Comments

@lxccc812
Copy link

Environment



Reproduction

None

Describe the bug

What happened is, after I used nuxt/i18n, my useRoute was not resolving my routes correctly.
Image

And prompted me to use ____en.
Image

Additional context

i18n config

i18n: {
        baseUrl: process.env.NUXT_PUBLIC_BASE_URL,
        locales: [
            {
                code: 'en',
                language: 'en-US',
                file: 'en-US.ts',
                domain: process.env.NUXT_PUBLIC_BASE_URL,
            },
            {
                code: 'ja',
                language: 'ja-JP',
                file: 'ja-JP.ts',
                domain: 'https://jp.example.com',
            },
        ],
        defaultLocale: 'en',
        lazy: true,
        differentDomains: true,
    },

Logs

@BobbieGoede
Copy link
Collaborator

This is expected behavior, this module localizes the routes in your project so these can differ depending on your routing strategy. We have composables that accept non localized parameters to provide similar functionalities, in your example you may want to try out useLocaleRoute.

@BobbieGoede BobbieGoede closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants