Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4133 pages
Next.js and React

next build or next dev fails because next-intl cannot locate its request configuration

Your error

Error: Couldn't find next-intl config file. Please follow the instructions at https://next-intl.dev/docs/getting-started/app-router1 more line it can show

Fix it fast

Most common cause, 1 of 3

The request configuration file does not exist

Create the file with getRequestConfig and return at least the locale and messages.

Fix
// i18n/request.ts   (or src/i18n/request.ts)
import { getRequestConfig } from 'next-intl/server'

export default getRequestConfig(async () => {
  const locale = 'en'
  return {
    locale,
    messages: (await import(`../messages/${locale}.json`)).default,
  }
})
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

next-intl needs two pieces in the App Router: the next-intl/plugin wrapper in next.config, and a request configuration file at i18n/request.ts (or src/i18n/request.ts). The error appears when the file is missing, sits somewhere else without its path being given to createNextIntlPlugin(), or when next.config does not use the plugin at all. Fix whichever piece is missing.

  • Applies to next-intl 4.15, Next.js 15.5, Node.js 24
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Check both pieces at once: is the plugin in next.config, and where is the request config file?

Run this first
grep -n "next-intl/plugin\|createNextIntlPlugin\|withNextIntl" next.config.*
ls i18n/request.* src/i18n/request.* 2>/dev/null

Then find the line you see in this list and open its fix:

  1. 1The request configuration file does not existNo i18n/request.* in the project root or in src/
  2. 2The file lives in a custom place and the plugin was not toldYou have a request config, but under a path like config/i18n.ts
  3. 3next.config does not wrap the config with the plugini18n/request.ts exists, but next.config exports a plain object

What does the error look like?

  • Error: Couldn't find next-intl config file. Please follow the instructions at https://next-intl.dev/docs/getting-started/app-router
  • Error occurred prerendering page "/t". Read more: https://nextjs.org/docs/messages/prerender-error

Cause 1 of 3

The request configuration file does not exist

You seeNo i18n/request.* in the project root or in src/

Check

The plugin docs say the file is looked up as i18n/request with a .ts, .tsx, .js or .jsx extension, both in src and in the project root. Projects set up from an older guide often have i18n.ts at the root instead.

Check
find . -path ./node_modules -prune -o -name 'request.*' -print -o -name 'i18n.*' -print

Fix

Create the file with getRequestConfig and return at least the locale and messages.

Fix
// i18n/request.ts   (or src/i18n/request.ts)
import { getRequestConfig } from 'next-intl/server'

export default getRequestConfig(async () => {
  const locale = 'en'
  return {
    locale,
    messages: (await import(`../messages/${locale}.json`)).default,
  }
})

Verify

next build gets past prerendering the pages that call getTranslations or useTranslations.

Verify
npx next build

Confirmed by next-intl.dev

Did this fix it?

Cause 2 of 3

The file lives in a custom place and the plugin was not told

You seeYou have a request config, but under a path like config/i18n.ts

Check

Only the default paths are searched. Any other location has to be passed to createNextIntlPlugin, either as the first argument or as requestConfig in the options object.

Check
grep -rn "getRequestConfig" --include=*.ts --include=*.js . | grep -v node_modules

Fix

Give the plugin the path relative to the project root.

Fix
// next.config.ts
import createNextIntlPlugin from 'next-intl/plugin'

const withNextIntl = createNextIntlPlugin('./config/i18n.ts')
export default withNextIntl({})

Verify

Build again; the pages that use translations prerender.

Verify
npx next build

Confirmed by next-intl.dev

Did this fix it?

Cause 3 of 3

next.config does not wrap the config with the plugin

You seei18n/request.ts exists, but next.config exports a plain object

Check

The request file is wired in by the plugin. Without the wrapper, next-intl's server functions have no way to load the file, and the same error is raised.

Check
cat next.config.*

Fix

Wrap the existing config. If other plugins also wrap it, pass the result of one into the next so none of them is dropped.

Fix
import type { NextConfig } from 'next'
import createNextIntlPlugin from 'next-intl/plugin'

const nextConfig: NextConfig = {
  // your options
}

const withNextIntl = createNextIntlPlugin()
export default withNextIntl(nextConfig)

Verify

A clean build finishes and the page renders the translated text.

Verify
rm -rf .next && npx next build

Confirmed by next-intl.dev

Did this fix it?

How do I stop it coming back?

  • Keep i18n/request.ts at the default path unless you have a strong reason not to.
  • When you combine several next.config wrappers, add a build in CI so a lost wrapper fails early.
  • Follow the guide for your next-intl major version; file names changed between releases.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.