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

next intl never type error #1596

Open
3 tasks done
ribastudio opened this issue Dec 5, 2024 · 2 comments
Open
3 tasks done

next intl never type error #1596

ribastudio opened this issue Dec 5, 2024 · 2 comments
Labels
bug Something isn't working reproduction-missing unconfirmed Needs triage.

Comments

@ribastudio
Copy link

Description

Im using next-intl at next 14.2.18 and next-intl 3.14, and this function don't allow to NextJs to build a project, because the t.rich function have a never type, and the initial implementation are the string index, and the object with a callback function to interpolate the code to a HTML tag respective

Verifications

Mandatory reproduction URL

https://github.com/amannn/next-intl-bug-repro-app-router

Reproduction description

Steps to reproduce:

  1. create a function t.rich on a nextjs normal page component

{t.rich("benefitsForAll", {
bolded: (chunks) => {chunks}
})}
2. Try to build with npm run build
3. See error:
Type error: Argument of type '"benefitsForAll"' is not assignable to parameter of type 'never'.

168 | <div className={styles["benefits-content-area"]} ref={sectionRef}>
169 | <h2 className={styles["benefits-section-title"]} ref={titleRef}>

170 | {t.rich("benefitsForAll", {
| ^
171 | bolded: (chunks) => {chunks}
172 | })}
173 |

Expected behaviour

the function t.rich expects to solve the translation correctly

@ribastudio ribastudio added bug Something isn't working unconfirmed Needs triage. labels Dec 5, 2024
@amannn
Copy link
Owner

amannn commented Dec 6, 2024

Here's an example on how to use t.rich:

Copy link

github-actions bot commented Dec 6, 2024

Thank you for your report!

Unfortunately, the reproduction is missing or incomplete, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically.

Templates:

Creating a good reproduction takes time.

To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you.

Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:

  1. Open reproduction
  2. Click on …
  3. See error: …

Thank you for your understanding!

FAQ

"I've included a reproduction, what is missing?"

This comment might have been added because your reproduction doesn't point to a destination where the issue can be reproduced. Please make sure that the latest changes were saved in the reproduction and that the link is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working reproduction-missing unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants