Skip to content

useTranslations type mismatch - Expected 0 arguments #2314

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

Closed
emmaielle opened this issue Jan 28, 2025 · 3 comments
Closed

useTranslations type mismatch - Expected 0 arguments #2314

emmaielle opened this issue Jan 28, 2025 · 3 comments

Comments

@emmaielle
Copy link

emmaielle commented Jan 28, 2025

useTranslations Type Mismatch - Expected 0 arguments, but got X

I'm following the set up and everything's working on the browser, but I see a type issue every time that I call the useTranslations t function:

Image

To Reproduce

import { useTranslation } from 'next-i18next';

export const Component = ({ appName }: Props) => {
    const { t } = useTranslation('common');

   ...
   return (
       <h1>{t('do-more.title', { appName })}</h1>
   )
}

Expected behavior

Not sure why it's expecting 0 arguments. It follows the basic way to call for a translation AND it's working.

fyi, I nuked all node_modules and reinstalled everything again in case it was a confusion with versions. Let me know what other type of context I can provide.

Your Environment

runtime version: i.e. browser, nextJS
os: Mac

{
   "i18next": "^22.2.2",
    "next": "^14.1.3",
    "next-i18next": "^15.14.1",
    "react-i18next": "^15.14.0"
}
@adrai
Copy link
Member

adrai commented Jan 28, 2025

Please provide a complete but minimal reproducible example repository... not just code snippets.
btw: might be the same as this: i18next/i18next#2280

@emmaielle
Copy link
Author

Please provide a complete but minimal reproducible example repository... not just code snippets. btw: might be the same as this: i18next/i18next#2280

Yeah, that's definitely the same issue. I'll spin up a repo in a bit then

Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 26, 2025
@stale stale bot closed this as completed May 6, 2025
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