Closed halgorithm closed 7 years ago
Weird. I will investigate further.
The issue appears to be info.rel
is not being carried over properly when using reactive calls in the foreach
loop. Or, perhaps, for whatever reason, resolveFilename(info.rel + "/" + relFilename)
does not begin with the string "client/views/"
Not to resurrect a dead thread/issue here, but could you simply add console.log(name)
right after line 31 in this file: https://github.com/bminer/meteor-blade/blob/master/runtime-meteor.js#L31 ??
Try it then and see what prints to the console before the error message. That would be extraordinarily helpful!
Closing this issue. Dropping Blade + Meteor support for now. :(
From what I understand, the filename provided to
include
is parsed relative to the current file's directory (not documented?). This behavior changes when usinginclude
within aforeach
on a Meteor Cursor object. For example:client/zCode/body.js
client/views/body.blade
client/views/posts/posts_list.blade
This code will render the 'posts/post' template three times for three posts in the Array returned by
Posts.find().fetch()
, as expected.However, change
Posts.find().fetch()
to justPosts.find()
(which returns a Cursor object), and this error prints each time it tries to run theinclude
:This can be "fixed" by editing 'client/views/posts/posts_list.blade" and changing
include 'post' exposing post
toinclude 'posts/post' exposing post
. It then renders the same as before. It seems like a bug to have the template path forinclude
be dependent on whether an Array or Cursor was used, though...