--turbopack causing problems with next-translate #76944
Labels
Internationalization (i18n)
Related to Internationalization with Next.js.
Turbopack
Related to Turbopack with Next.js.
Link to the code that reproduces this issue
https://github.com/kahur/nextjs-translate-turbopack-reproduction
To Reproduce
i18n.json
next.config.ts
It will result in error:
TypeError: (0 , {imported module [project]/nodemodules/next/dist/server/route-modules/app-page/vendored/rsc/react.js [app-rsc] (ecmascript)}.useContext) is not a function
The issue disappears, when you force page to render as client by "use client".
Current vs. Expected behavior
Current: Using useTranslate hook in server component will cause error
Expected: Using useTranslate hooks works as in client component.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 Available memory (MB): 65536 Available CPU cores: 10 Binaries: Node: 21.5.0 npm: 10.8.2 Yarn: 1.22.21 pnpm: 8.14.3 Relevant Packages: next: 15.2.1 // Latest available version is detected (15.2.1). eslint-config-next: 15.2.1 react: 19.0.0 react-dom: 19.0.0 typescript: 5.8.2 Next.js Config: output: standalone
Which area(s) are affected? (Select all that apply)
Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I have tested this issue also with turning off --turbopack and it works as expected. So this is related to turbo.
The text was updated successfully, but these errors were encountered: