Try this :
in your next-i18next.config.js:
const path = require('path')
module.exports = {
i18n: {
defaultLocale: 'fr',
locales: ['en', 'fr'],
localePath: path.resolve('./public/locales')
},
};
and in your _app.js try to pass the config file as a sencond param like this :
import { appWithTranslation } from 'next-i18next'
import nextI18NextConfig from '../../next-i18next.config'
....
export default appWithTranslation(MyApp, nextI18NextConfig);
N.B if you are using Next.js's dynamic import feature to load a module only on the client side disable it otherwise it will not work
export default dynamic(() => Promise.resolve(index), { ssr: false }); //to be removed