Uncaught Error: Couldn't find a Layout component in the rendered component tree

StackOverflow https://stackoverflow.com/questions/22771486

  •  25-06-2023
  •  | 
  •  

문제

I'm receiving an error with Iron Router 0.7.0 on Meteor 0.8.0.

Within the UI.Compenent.lookup function in blaze-layout's layout.js, the following error is triggering:

Uncaught Error: Couldn't find a Layout component in the rendered component tree

It's hard to know exactly what is causing this error and what isn't working because of it. Any ideas?

Thanks in advance.

도움이 되었습니까?

해결책

I just got the same error, for me it was caused by including my layout template within <body>, and specifying it as the layoutTemplate option. To fix it, I removed the include from <body>.

Here is a before and after of 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 (after)

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

<body>
</body>

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

example.js (after -- same as before)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top