Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'translator' of undefined #108

Closed
leandrocamacho opened this issue Jun 3, 2016 · 4 comments
Closed

TypeError: Cannot read property 'translator' of undefined #108

leandrocamacho opened this issue Jun 3, 2016 · 4 comments

Comments

@leandrocamacho
Copy link

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)

@jamuhl
Copy link
Member

jamuhl commented Jun 3, 2016

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

@jamuhl jamuhl closed this as completed Jun 28, 2016
@strarsis
Copy link

strarsis commented Dec 14, 2016

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.

@jamuhl
Copy link
Member

jamuhl commented Dec 15, 2016

https://github.com/i18next/i18next-express-middleware might be what you search

@jamuhl
Copy link
Member

jamuhl commented Dec 15, 2016

we assign t to locals like: https://github.com/i18next/i18next-express-middleware/blob/master/src/index.js#L33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants