From aa848c92f81ac97b4d1de7317e7bef9a96262081 Mon Sep 17 00:00:00 2001 From: myl7 Date: Sun, 6 Feb 2022 17:26:46 +0800 Subject: [PATCH] add trailing slash config to fix i18n with api routes --- next.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index f296f91..fa13553 100644 --- a/next.config.js +++ b/next.config.js @@ -2,5 +2,7 @@ const { i18n } = require('./next-i18next.config') module.exports = { i18n, - reactStrictMode: true + reactStrictMode: true, + // Required by Next i18n with API routes, otherwise API routes 404 when fetching without trailing slash + trailingSlash: true }