So after using react for months now I have to go back to Blaze for a little, older project. For some reason I can’t get it to work anymore to load any templates/partials from subfolders.
<template name="layout">
{{> header}} // I also tried {{> partials/header}} or {{> ./partials/header}} - no luck!
<main class="container-big">
{{> yield}}
</main>
</template>
ERROR:Error: No such template: header
I don’t get it. It seems to be a very simple mistake I am making here - again, haven’t used Blaze in many many months - but I can’t find the error.
Any help please!
I tried just import './partials/header.html'inside a layout.js file - did not change anything.
What is the proper way to include partials when using FlowRouter?
This is not specific to FlowRouter but standard ES6. You need to make sure that your import statement covers all dependencies. So usually importing the header in layout.js would do the trick, but you also need to import layout.js. Is login.js importing layout.js?
Or, you could go back to the eager imports that make small projects so fast to work with by removing the "meteor" key from package.json
Then you don’t need to worry about imports because everything will always be eagerly loaded.
Note: This would remove any benefit of using the dynamic import in your routes