Getting edge runtime error in next js i18 for localePath

const path = require('path');
export const i18n = {
  defaultLocale: "en",
  locales: ["en", "ch", "ko", "jp"],
} as const;

export const nextI18NextConfig = {
  i18n,
  // Path to the translation files
  // i.e., ./public/locales/en.json, ./public/locales/ch.json, etc.
  localePath: path.resolve('./public/dictionaries'),
  outputFileTracing:true
} as const;

export type Locale = (typeof i18n)["locales"][number];

Above is my i18n-config.ts code and I want to use localePath to get the language jsons to be read on vercel. The project is working fine without localePath on local but for vercel, it needs the key. Whenever I add the key it looks like the path package is not allowed.

**
But most of the solutions around the web use it, but they have next-config.js not ts
**

The reason I am using the localePath is because the vercel app is throwing 404 for my language translation json files

Leave a Comment