Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot read property '_liveui' of null

Tags:

meteor

I'm getting client side errors(console.log ones) but my app works(I can add users)

The error is the following: Uncaught TypeError: Cannot read property '_liveui' of null

The project is in my repo: https://github.com/thiagofm/statusfyit

What is happening?

like image 693
thiagofm Avatar asked Jan 23 '26 13:01

thiagofm


1 Answers

Meteor has updated its API a bunch since this question was asked, so the original code no longer runs directly.

Using jQuery.html to insert the results of rendering a template is not the normal approach. It is better to use the handlebars template include functionality.

For example, replace:

$().ready(function(){
  hello = Meteor.ui.render(function(){
    return Template.hello();
  });
  $('body').html(hello);
});

With:

<body>
  {{> hello}}
</body>

To render different things depending on the state of the application, use the 'Session' object to conditionalize includes. For example:

<template name="foo">
  {{#if showNewUserDialog}}
    {{> newUserDialog}}
  {{else}}
    other stuff
  {{/if}}
</template>

<template name="newUserDialog">
  some stuff
</template>

and

Template.foo.showNewUserDialog = function () {
  return Session.get('showNewUserDialog');
};
Template.other.events({
  'click #new_user': function () {
     Session.set('showNewUserDialog', true);
  }
});
like image 168
n1mmy Avatar answered Jan 25 '26 20:01

n1mmy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!