-
Notifications
You must be signed in to change notification settings - Fork 106
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
async calls to getLanguage to support nextjs 15 #3188
async calls to getLanguage to support nextjs 15 #3188
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
@tconroy I think, it's best to mirror the new (async) function signatures in the client files ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge and release with the minor request to change the client types to be sync.
inlang/source-code/paraglide/paraglide-next/src/app/getLanguage.server.ts
Show resolved
Hide resolved
@tconroy @asterikx to get this PR merged and released, i would go ahead and change the client function types to be sync again #3188 (comment). if nobody objects, I'll do the change tmr and get this PR published :) |
7cbf4cd
to
e4e1f08
Compare
Sounds good. I've reverted that commit and have also merged in latest master to this branch, so should be all set. |
Published as v0.7. Thanks @tconroy for the PR! |
Relates to issue: opral/inlang-paraglide-js#245
Starting with latest RC of Next.js 15 (RC 2), the request APIs (including
headers()
) is async: nextjs.org/blog/next-15-rc2#async-request-apis-breaking-change.This change breaks the
getLanguage()
function from@inlang/paraglide-next
, (on the server):opral/monorepo@a0aaf62/inlang/source-code/paraglide/paraglide-next/src/app/getLanguage.server.ts#L14
This PR updates the
getLanguage()
function (every function that uses it) to be async.Note: I was not actually able to test this locally in-repo, as I don't have Doppler access and couldn't get the local env running fully. However I did run unit tests and build, both of which appeared to be passing.