React-i18next: TypeError: Cannot read property 'translator' of undefined

Created on 3 Jun 2016  路  4Comments  路  Source: i18next/react-i18next

Hello friends.

I found this error in the server log and the application does not work. What can it be?

TypeError: Cannot read property 'translator' of undefined at t (/home/myapp/app/node_modules/i18next/dist/commonjs/i18next.js:315:16) at eval (eval at <anonymous> (/home/myapp/app/node_modules/jade/lib/index.js:218:8), <anonymous>:1192:482) at eval (eval at <anonymous> (/home/myapp/app/node_modules/jade/lib/index.js:218:8), <anonymous>:1598:129) at res (/home/myapp/app/node_modules/jade/lib/index.js:219:38) at Object.exports.renderFile (/home/myapp/app/node_modules/jade/lib/index.js:380:38) at Object.exports.renderFile (/home/myapp/app/node_modules/jade/lib/index.js:370:21) at View.exports.__express [as engine] (/home/myapp/app/node_modules/jade/lib/index.js:417:11) at View.render (/home/myapp/app/node_modules/express/lib/view.js:126:8) at tryRender (/home/myapp/app/node_modules/express/lib/application.js:639:10) at EventEmitter.render (/home/myapp/app/node_modules/express/lib/application.js:591:3) TypeError: Cannot read property 'translator' of undefined at t (/home/myapp/app/node_modules/i18next/dist/commonjs/i18next.js:315:16) at eval (eval at <anonymous> (/home/myapp/app/node_modules/jade/lib/index.js:218:8), <anonymous>:1192:482) at eval (eval at <anonymous> (/home/myapp/app/node_modules/jade/lib/index.js:218:8), <anonymous>:1598:129) at res (/home/myapp/app/node_modules/jade/lib/index.js:219:38) at Object.exports.renderFile (/home/myapp/app/node_modules/jade/lib/index.js:380:38) at Object.exports.renderFile (/home/myapp/app/node_modules/jade/lib/index.js:370:21) at View.exports.__express [as engine] (/home/myapp/app/node_modules/jade/lib/index.js:417:11) at View.render (/home/myapp/app/node_modules/express/lib/view.js:126:8) at tryRender (/home/myapp/app/node_modules/express/lib/application.js:639:10) at EventEmitter.render (/home/myapp/app/node_modules/express/lib/application.js:591:3) TypeError: Cannot read property 'translator' of undefined at t (/home/myapp/app/node_modules/i18next/dist/commonjs/i18next.js:315:16) at eval (eval at <anonymous> (/home/myapp/app/node_modules/jade/lib/index.js:218:8), <anonymous>:266:1647) at eval (eval at <anonymous> (/home/myapp/app/node_modules/jade/lib/index.js:218:8), <anonymous>:272:23) at res (/home/myapp/app/node_modules/jade/lib/index.js:219:38) at Object.exports.renderFile (/home/myapp/app/node_modules/jade/lib/index.js:380:38) at Object.exports.renderFile (/home/myapp/app/node_modules/jade/lib/index.js:370:21) at View.exports.__express [as engine] (/home/myapp/app/node_modules/jade/lib/index.js:417:11) at View.render (/home/myapp/app/node_modules/express/lib/view.js:126:8) at tryRender (/home/myapp/app/node_modules/express/lib/application.js:639:10) at EventEmitter.render (/home/myapp/app/node_modules/express/lib/application.js:591:3)

Most helpful comment

All 4 comments

did you init 18next? can you paste your config?

I had to assign the whole i18n instance object to pug (formerly jade) locals instead just the t(...) method.
Edit: This seems to be a i18next related issue, not specifically to React.

Was this page helpful?
0 / 5 - 0 ratings