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

t is not a function #1326

Closed
3 tasks done
imbhargav5 opened this issue Sep 5, 2024 · 3 comments · Fixed by #1327
Closed
3 tasks done

t is not a function #1326

imbhargav5 opened this issue Sep 5, 2024 · 3 comments · Fixed by #1327
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@imbhargav5
Copy link

Description

I see t is not a function error when I try to use the Link component exported by @/i18n/routing. My understanding is that the Link component is implemented independently in both server and client component environments and should work in both places. However, I am running into this issue in the server environment and the client environment works fine.

image

Verifications

  • I've verified that the problem I'm experiencing isn't covered in the docs.
  • I've searched for similar, existing issues on GitHub and Stack Overflow.
  • I've compared my app to a working example to look for differences.

Mandatory reproduction URL

https://github.com/imbhargav5/next-intl-bug-repro

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. Start dev server on 3000
  3. Home page will error on the server

Expected behaviour

There should be no t is not a function error in the server side and the Link function should use the current locale from cache and navigate correctly.

@amannn
Copy link
Owner

amannn commented Sep 5, 2024

Your example is broken because you've specified the wrong path in next.config.mjs. Please make sure to link to your request configuration, not your routing configuration. If you remove the override in the reproduction, then your i18n/request.ts file is picked up correctly.

I've added #1327 to introduce error handling for this case, thanks for the report!

@imbhargav5
Copy link
Author

Amazing. Your speed is next level. Thanks for this amazing project good sir!

@amannn
Copy link
Owner

amannn commented Sep 5, 2024

Awesome, happy to help! 😊

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