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

not working with Meteor 1.2.0.2 #35

Open
sanidkpc opened this issue Sep 30, 2015 · 10 comments
Open

not working with Meteor 1.2.0.2 #35

sanidkpc opened this issue Sep 30, 2015 · 10 comments

Comments

@sanidkpc
Copy link

meteor-ssr not working with latest meteor release[v1.2.0.2]
Error response:
TypeError: Cannot call method 'charAt' of undefined
at packages/blaze/packages/blaze.js:1609:1
at packages/meteorhacks_ssr/packages/meteorhacks_ssr.js:49:1
at Object.Blaze._TemplateWith (packages/meteorhacks_ssr/packages/meteorhacks_ssr.js:64:1)
at [object Object]._render (packages/meteorhacks_ssr/packages/meteorhacks_ssr.js:153:1)
at packages/blaze/packages/blaze.js:557:1
at Object.Blaze._withCurrentView (packages/blaze/packages/blaze.js:670:1)
at Object.Blaze._expandView (packages/blaze/packages/blaze.js:556:1)
at [object Object].Blaze._HTMLJSExpander.def.visitObject (packages/blaze/packages/blaze.js:581:1)
at [object Object].HTML.Visitor.def.visit (packages/htmljs/packages/htmljs.js:91:1)
at Object.Blaze._expand (packages/blaze/packages/blaze.js:615:1)
at Object.Blaze._expandView (packages/blaze/packages/blaze.js:561:1)

@darrynten
Copy link
Contributor

Fixed in #37

@sanidkpc
Copy link
Author

Thanks @darrynten

@ryanswapp
Copy link

I'm getting the same error...

Exception while invoking method 'pokemon/generate_pdf' TypeError: Cannot call method 'charAt' of undefined
I20151103-08:43:25.025(-7)?     at packages/blaze/lookup.js:187:1
I20151103-08:43:25.025(-7)?     at packages/meteorhacks_ssr/lib/overrides.js:41:1
I20151103-08:43:25.026(-7)?     at Object.Blaze._TemplateWith (packages/meteorhacks_ssr/lib/overrides.js:56:1)
I20151103-08:43:25.026(-7)?     at [object Object]._render (packages/meteorhacks_ssr/lib/dynamic.js:16:1)
I20151103-08:43:25.026(-7)?     at packages/blaze/view.js:425:1
I20151103-08:43:25.026(-7)?     at Object.Blaze._withCurrentView (packages/blaze/view.js:538:1)
I20151103-08:43:25.026(-7)?     at Object.Blaze._expandView (packages/blaze/view.js:424:1)
I20151103-08:43:25.026(-7)?     at [object Object].Blaze._HTMLJSExpander.def.visitObject (packages/blaze/view.js:449:1)
I20151103-08:43:25.026(-7)?     at [object Object].HTML.Visitor.def.visit (packages/htmljs/visitors.js:61:1)
I20151103-08:43:25.026(-7)?     at Object.Blaze._expand (packages/blaze/view.js:483:1)

I'm running Meteor 1.2.1. Any idea as to what's going on?

@Streemo
Copy link

Streemo commented Nov 13, 2015

I am also getting this error in 1.2.1. It seems like SSR.render('layout', context) is throwing. It's making it impossible to use the package.

context = {
  main: 'home'
}

has trouble getting the 'home' template.

@Streemo
Copy link

Streemo commented Nov 13, 2015

//works
{{> home}}
//does not work
//main === 'home'
{{>Template.dynamic template=main}}

Temporary fix:

{{#if atHome}}
  {{>home}}
{{else}}
  ...
{{/if}}

@jonnymd
Copy link

jonnymd commented Mar 16, 2016

@ryanswapp Did you resolve the error? I'm trying to follow a tutorial that you wrote on Nov 3 (same date as your post here)

https://medium.com/@ryanswapp/getting-started-with-meteor-and-react-d411a87a1674#.rv51jica7

and I'm getting this same error...

@ryanswapp
Copy link

@jonnymd I did! However, I'm not exactly sure what I did... It's been a little while. Maybe try cloning my repo and seeing if the app in the final directory works for you locally. If so, compare your code and see if there are any differences. Here is the link https://github.com/ryanswapp/meteor-pdf-tutorial

I wish I could remember what I did... Sorry about that

@jonnymd
Copy link

jonnymd commented Mar 16, 2016

Just FYI, I cloned your repo and the final worked locally. Not sure what was different but that seemed to work. Thanks for writing the tutorial.

Also, based on ryanswapps usage of this in his tutorial I believe this issue could be closed (seems resolved).

@ryanswapp
Copy link

Good to hear! Glad it's working. Wish I could remember what I did to fix the issue... haha

@Alino
Copy link

Alino commented Aug 17, 2016

I think I know how you fixed it.
The problem disappeared as soon as I called the dynamic template with data object as well. (in my case I didn't need to pass any data inside template data context so I am passing an empty object)

js

const html = SSR.render("email", {
  template: "emailXmlValidationError",
  data: {}
});

html

{{> Template.dynamic template=template data=data}}

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

6 participants