Search error: could not find the layout component in the render component tree

I get an error with Iron Router 0.7.0 on Meteor 0.8.0.

Inside the UI.Compenent.lookup function in the layout.js blaze, the following error appears:

Problem: Could not find the layout component in the rendering of the component tree

It is difficult to know exactly what causes this error and what does not work because of it. Any ideas?

Thanks in advance.

+4
source share
1 answer

I have only one error, for me it is caused by including my layout template in <body>and specifying it as an option layoutTemplate. To fix this, I removed include from <body>.

Here is before and after my code;

example.html (before)

<head>
  <title>example</title>
</head>

<body>
   {{>layout}}
</body>

<template name="layout">
    <div>{{>yield}}</div>
</template>

example.js (before)

if(Meteor.isClient) {

Router.configure({
    layoutTemplate: 'layout'
});

}

example.html()

<head>
  <title>example</title>
</head>

<body>
</body>

<template name="layout">
    <div>{{>yield}}</div>
</template>

example.js( - , )

+9

Source: https://habr.com/ru/post/1534322/


All Articles