`Exception in template helper: TypeError: Cannot read property 'undefined' of undefined - meteor

I made a site using Telescope but when load I get this error message in my browser-console. How to fix this error.
Exception in template helper: TypeError: Cannot read property 'undefined' of undefined
at Object.Template.avatar.helpers.size (http://localhost:3000/packages/utilities_avatar.js?76304dc56cbb0aaaef4d60c3d930750cea5ac835:96:37)
at bindDataContext (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2880:16)
at Blaze._wrapCatchingExceptions (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:1651:16)
at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2928:66
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:3476:12)
at wrapHelper (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2927:27)
at Spacebars.call (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:172:18)
at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:109:25)
at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:113:39)
at Template.avatar.HTML.DIV.class (http://localhost:3000/packages/utilities_avatar.js?76304dc56cbb0aaaef4d60c3d930750cea5ac835:48:82)

Here is answer for your problem: Stack-link
Read about guarding, problem you have appears due to missing variable / key / method, because it is not yet loaded. It mostly works cause it gets loaded but unless it comes to webbrowser you recieve this error message.

Go and look through your app and look close to the Template's name and the helpers, events. Maybe a Template.yourtemplate.helper or Template.yourtemplate.event isnt equal with your HTML Template name

Related

Facebook pixel: fbevents.js cause error "Cannot read property 'replace' of undefined"

When I click certain elements on the page it throws this error
Can anyone explain why is it happening?
When initializing:
fbq('init', "your_app_id");
your_app_id must be string

Uncaught Error: ReCAPTCHA placeholder element must be empty

I am getting below mentioned error in Browser Console. I have used Contact form 7 and Google Captcha in wordpress site.
(1) Uncaught Error: ReCAPTCHA placeholder element must be empty
(2) Uncaught error: invalid recaptcha client id: undefined
Can please assist me to fix these issues.
Remove this from the <head></head>. It’s redundant.
<script src='https://www.google.com/recaptcha/api.js'></script>
This is old, and might be a duplicate, but this is the page I found trying to solve my problem, so I figured I'd add something towards an answer here.
I was getting the "ReCAPTCHA placeholder element must be empty" error, and it was because the recaptcha script was being called multiple times. I was able to resolve this with a custom callback on the recaptcha's onload event:
var recaptchacalls = 0;
var onloadCallback = function(e) {
grecaptcha.render('cap-' + recaptchacalls, {
'sitekey' : '<SITE_KEY_HERE>'
});
recaptchacalls++;
};
Note the count of how many times the script is called, using that as a unique identifier for the specific container that we need to be empty.
I would venture a guess that the other error is related, non-specific identifiers in multiple calls resulting in actions being attempted on the wrong object.

trying to output to pdf using weasyprint fails css

I'm trying to output a pdf from django. I am using weasyprint. Here is my view:
def fleet_report_pdf(request):
template = loader.get_template("Reports/fleetreport.html")
context = {
'crews': models.Unit.objects.all().annotate(c=Count('memberunit__Member')),
's31': models.Member.objects.filter(memberunit__isnull=True)
}
html = template.render(RequestContext(request, context))
response = HttpResponse(content_type="application/pdf")
weasyprint.HTML(string=html, base_url=request.build_absolute_uri(), url_fetcher=request).write_pdf(response)
return response
The pdf loads however, the page is not styled. when digging further, I noticed errors like these in the console:
Failed to load stylesheet at http://127.0.0.1:8000/static/css/layout.css : TypeError: 'WSGIRequest' object is not callable
Failed to load stylesheet at http://127.0.0.1:8000/static/css/darkblue.css : TypeError: 'WSGIRequest' object is not callable
Failed to load stylesheet at http://127.0.0.1:8000/static/css/custom.css : TypeError: 'WSGIRequest' object is not callable
This tells me that I'm missing something. How to make the stylesheets callable? Thanks.
You are using request object as a url fetcher in your weasyprint.HTML call (url_fetcher=request). You shouldn't need to provide this argument for fetching simple resources that does not require authentication or so.
See this for details on URL fetchers.

Semantic UI Search Module disable default error messages

Is there a way to disable the error messages from the search module in Semantic. I tried setting the error configuration as undefined like this:
$('search').search({
error: undefined
});
But it did not work, can someone help me please.
I found the way to disable it is just setting the error attribute at the configuration to false like this:
$('search').search({ error: false });

Parsing Meteor error: Exception from Deps afterFlush

I get these Deps errors from time to time and I can never figure out what they mean or what they're pointing to:
Exception from Deps afterFlush function function: SyntaxError: Unexpected identifier
at eval (native)
at http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:372:22
at Function.jQuery.extend.globalEval (http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:373:7)
at jQuery.ajaxSetup.converters.text script (http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:9806:11)
at ajaxConvert (http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:8873:18)
at done (http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:9293:15)
at callback (http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:9753:8)
at Object.send (http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:9759:7)
at Function.jQuery.extend.ajax (http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:9244:15)
at Function.jQuery._evalUrl (http://localhost:4000/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4:9409:16) debug.js:41
It thinks that there is a syntax error, but the only files it points to are jquery.js, which I HIGHLY doubt contain errors...
This error is caused by code in a Template helper somewhere that uses JQuery/a jquery plugin and is running code using eval which contains a syntax error in it, which is why it appears to come from JQuery itself.
There isn't much more than this to go off im afraid. It might be from ajax. Have a look at your chrome's network tab to see what is being downloaded just before this happens and see if it contains any javascript.
If it contains HTML when it should contain javascript check your Meteor paths, Meteor does not throw 404 errors, instead it serves out the main page's html, which may be why the error displays this way instead of a 404
I just came across the similar "afterFlush" error, and while my error was also rooted in a jQuery/plugin with Meteor, it had nothing to do with eval.
The issue circled back around to updating the DOM at the same time I was updating a reactive method, where Meteor was also updating the DOM reactively. I found this out, and removed the manual DOM manipulation, which made this error go away. Hope someone else finds this helpful...

Resources