0

After installing next-i18next I keep getting this error even in pages where I am not using it. I'm not sure how to fix it. Thankfully it isn't breaking anything but this is my next-i18next.config.js

module.exports = {
  i18n: {
    locales: ['en', 'fr', 'de', 'it', 'es'],
    defaultLocale: 'es',
  },
};

this is my getServerSideProps in my page, (baseUrl is a separate thing not having to go with translations)

export async function getServerSideProps({locale}) {
  const { publicRuntimeConfig } = getConfig();
  
  return {
    props: {
      baseUrl: publicRuntimeConfig.API_BASE_URL ? publicRuntimeConfig.API_BASE_URL : null,
      ...(await serverSideTranslations(locale, ['dashboard'])),
      // Will be passed to the page component as props
    },
  }
}

and my _app.js

import {AuthProvider} from '../context/AuthContext';
import { UserProvider } from '../context/UserContext';
import ProtectedRoute from '../controllers/ProtectedRoute';
import {appWithTranslation} from 'next-i18next';

function MyApp({ Component, pageProps, router }) {

  return (
    <AuthProvider>
      <UserProvider>
        <ProtectedRoute router={router}>
          <Component {...pageProps} />
        </ProtectedRoute>
      </UserProvider>
    </AuthProvider>
  )
}

export default appWithTranslation(MyApp);

0 Answers0