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

View render error when i18n hook is disabled #3742

Closed
Mordred opened this issue May 24, 2016 · 2 comments · Fixed by #3741
Closed

View render error when i18n hook is disabled #3742

Mordred opened this issue May 24, 2016 · 2 comments · Fixed by #3741

Comments

@Mordred
Copy link
Contributor

Mordred commented May 24, 2016

Sails version: 0.12.2
Node version: 5.10.0
NPM version: 3.8.3
Operating system: OS X


After upgrade of i18n in the 0.12.2 sails.renderView() no longer works when i18n hook is disabled.

Error:

TypeError: Cannot read property 'undefined' of undefined
    at Object.i18nSetLocale [as setLocale] (/Users/martin/projects/xxx/intranet/node_modules/i18n/i18n.js:419:44)
    at module.exports.guessLanguage (/Users/martin/projects/xxx/intranet/node_modules/i18n/i18n.js:746:17)
    at Object.i18nInit [as init] (/Users/martin/projects/xxx/intranet/node_modules/i18n/i18n.js:181:7)
    at Hook.render (/Users/martin/projects/xxx/intranet/node_modules/sails/lib/hooks/views/render.js:95:19)
    at Sails.wrapper [as renderView] (/Users/martin/projects/xxx/intranet/node_modules/sails/node_modules/lodash/index.js:3095:19)
    at PDFService.js:127:13
    at PDFService.js:126:12
    at tryCatchReject (/Users/martin/projects/xxx/intranet/node_modules/when/lib/makePromise.js:845:30)
    at runContinuation1 (/Users/martin/projects/xxx/intranet/node_modules/when/lib/makePromise.js:804:4)
    at Fulfilled.when (/Users/martin/projects/xxx/intranet/node_modules/when/lib/makePromise.js:592:4)
    at Pending.run (/Users/martin/projects/xxx/intranet/node_modules/when/lib/makePromise.js:483:13)
    at Scheduler._drain (/Users/martin/projects/xxx/intranet/node_modules/when/lib/Scheduler.js:62:19)
    at Scheduler.drain (/Users/martin/projects/xxx/intranet/node_modules/when/lib/Scheduler.js:27:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9)

Source:

sails.renderView(`pdfs/${template}`, localVars, (err, html) => {
  ...
});
@sailsbot
Copy link

Hi @Mordred! It looks like you missed a step or two when you created your issue. Please edit your comment (use the pencil icon at the top-right corner of the comment box) and fix the following:

  • Verify "I am experiencing a concrete technical issue (aka a bug) with Sails (ideas and feature proposals should follow the guide for proposing features and enhancements (http://bit.ly/sails-feature-guide), which involves making a pull request). If you're not 100% certain whether it's a bug or not, that's okay--you may continue. The worst that can happen is that the issue will be closed and we'll point you in the right direction."
  • Verify "I am not asking a question about how to use Sails or about whether or not Sails has a certain feature (please refer to the documentation(http://sailsjs.org), or post on http://stackoverflow.com, our Google Group (http://bit.ly/sails-google-group) or our live chat (https://gitter.im/balderdashy/sails)."
  • Verify "I have already searched for related issues, and found none open (if you found a related closed issue, please link to it in your post)."
  • Verify "My issue title is concise, on-topic and polite ("jst.js being removed from layout.ejs on lift" is good; "templates dont work" or "why is sails dumb" are not so good)."
  • Verify "I have tried all the following (if relevant) and my issue remains:"
  • Verify "I can provide steps to reproduce this issue that others can follow."

As soon as those items are rectified, post a new comment (e.g. “Ok, fixed!”) below and we'll take a look. Thanks!

If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact inquiries@treeline.io.

@Mordred
Copy link
Contributor Author

Mordred commented May 24, 2016

Ok, fixed!

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

Successfully merging a pull request may close this issue.

2 participants