TypeError: Cannot read property 'namespacesRequired' of undefined
See original GitHub issueI got this error after update the package to version 0.20.0
TypeError: Cannot read property 'namespacesRequired' of undefined
at Function._callee$ (xxx\node_modules\next-i18next\dist\hocs\app-with-translation.js:169:69)
at tryCatch (xxx\node_modules\regenerator-runtime\runtime.js:62:40)
at Generator.invoke [as _invoke] (xxx\node_modules\regenerator-runtime\runtime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (xxx\node_modules\regenerator-runtime\runtime.js:114:21)
at asyncGeneratorStep (xxx\node_modules\@babel\runtime\helpers\asyncToGenerator.js:3:24)
at _next (xxx\node_modules\@babel\runtime\helpers\asyncToGenerator.js:25:9)
After investigated. I found that the error occur when I add getInitialProps in _app.jsx like below.
class MyApp extends App {
static async getInitialProps({ ctx }) {
return {}
}
render () {
const { Component, pageProps } = this.props
return (
<Container>
<Component {...pageProps} />
</Container>
)
}
}
export default appWithTranslation(MyApp)
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'namespacesRequired' of ...
I got this error after update the package to version 0.20.0 TypeError: Cannot read property 'namespacesRequired' of undefined at Function.
Read more >Connecting NextJS, next-i18next, with-redux, with-redux-saga ...
For anyone coming to this issue and wondering what @cerulean meant in his answer. 1) use require instead of import. NextJS doesn't transpile ......
Read more >I need help. TypeError: Cannot read properties of undefined ...
I need help. TypeError: Cannot read properties of undefined (reading 'current') function QuizLogic(showScore, totalTime, fetchQuestions, ...
Read more >Cannot read property 'namespacesRequired' of undefined
TypeError : Cannot read property 'namespacesRequired' of undefined.
Read more >react-i18next - npm
For Typescript users, if you are running into issues, such as Uncaught TypeError: Cannot read property 'off' of undefined , it's possible ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Got a similar issue, I’m using other HOC like “withRedux” and “withRedux” saga, My problem was fixed by moving “appWithTranslation” to the first level :
export default withRedux(makeStore)(withReduxSaga(appWithTranslation(MyApp)))
I don’t know if my problem is same at this. But I faced the same error in server side when production build though it don’t reproduce in development server. My version of this library is 0.31.0