Skip to content

Unable to use with RSC when mode is async #1023

@ScreamZ

Description

@ScreamZ

Description

Note

This post has been updated, please see answers in post below for changes, this is only kept for history.

Hi,

For various reason, i need my RSC to be asynchronous (data fetching). Maybe I've missed something

❌ Not working

import { useTranslations } from "next-intl";

export default async function Home() {
  const t = useTranslations("Index");
  return <h1>{t("title")}</h1>;
}

✅ Working

import { useTranslations } from "next-intl";

export default function Home() {
  const t = useTranslations("Index");
  return <h1>{t("title")}</h1>;
}

By just removing async keyword the following error message disappear and 500 HTTP is not present

GET /en 500 in 503ms
 ⨯ Error: failed to pipe response
}

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/ScreamZ/repro-temp

Reproduction description

pnpm install or whatever

just run app and go on first page

Expected behaviour

No crash or something to work around ? I might have missed something in the doc ? :'(

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingunconfirmedNeeds triage.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions