question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: _reactI18next2.default is undefined

See original GitHub issue

Hi! It’s very pity, that there is no any good step-by-step tutorials regarding react-i18next setup and use. I’m trying to recreate example from repo, but receiving this error: TypeError: _reactI18next2.default is undefined My index.js is:

import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { ModalContainer } from 'react-router-modal';
import LandingPage from './components/villages/Landing Page.js';
import WOW from 'wowjs';

import { I18nextProvider } from 'react-i18next';
import i18n from './i18n';
import registerServiceWorker from './registerServiceWorker';

class App extends React.Component {
  componentDidMount() {
    new WOW.WOW().init();
  }

  render() {
    return (
      <div>
        <LandingPage/>
        <ModalContainer />
      </div>
    )
  }
}

ReactDOM.render(
    <I18nextProvider i18n={ i18n }>
      <BrowserRouter>
          <App />      
      </BrowserRouter>
    </I18nextProvider>,
     document.getElementById('app')
);
registerServiceWorker();

I’ve put both i18n.js and registerServiceWorker.js in my folder. In i18n.js.js I’ve commented the locize imports.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
jamuhlcommented, Sep 24, 2017

TechnologiesBlock is not extended by translate hoc - so there won’t be any t in props.

module.exports = translate()(TechnologiesBlock)

1reaction
jamuhlcommented, Sep 28, 2017

you can’t export 2 “things” as default…you can use named exports if you need to export multiple objects, functions, …

if you do not need an export const ExtendedAnotherModal = translate()(AnotherModal); is all needed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: t(...).default is undefined - Stack Overflow
Browser throws the following exception: Uncaught TypeError: s.default is undefined It only returns this error in my browser console.
Read more >
how to setup react-i18n with hooks, getting TypeError - Reddit
While trying to setup react-i18n with hooks, comes this error TypeError: Cannot read property '0' of undefined. Here is i18n.js
Read more >
React JS UNDEFINED Solution | Reactjs Learning - YouTube
TypeError : Cannot read property 'map' of undefined - Map is not a function- ... Use empty array as default initial state or...
Read more >
is not a function or its return value is not iterable in ReactJs ...
TypeError : react__WEBPACK_IMPORTED_MODULE_0_default is not a function ... 2 | 3 | export default function SearchingText() { 4 | const [text, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found