Closed vraptor75011 closed 11 years ago
Apparently this issue is due to a new feature in Meteor : "We've added file-level JavaScript variable scoping. Variables declared with var at the outermost level of a JavaScript source file are now private to that file. Remove the var to share a value between files."
In coffee files, il I write : "@Posts = new Meteor.Collection ..." I can access the collection. But when accessing the posts variable in posts.blade (loop foreach), the helper Template[posts/posts].posts doesn't work well and throw
Exception from Deps afterFlush function: @http://0.0.0.0:3000/packages/blade/runtime-meteor.js?7c5904495c94aa75a5773b28d6e4671d29e90f23:45
The problems seems to be with the include in my foreach loop "include 'post' exposing post
Still investigating ...
Working if I copy from v3.0.3 runtime-meteor runtime
and if the included files are : "../posts/post"
I'm confused. What, exactly, is the problem here?
with latest meteor-blade version tag: https://github.com/bminer/meteor-blade.git#v3.2.2meteor2
Looks like #154 , include post exposing post in a foreach loop
If i copy runtime-meteor.js and runtime.js from v3.0.3 (which solved #154 )
I cannot replicate this bug. Please post your post.blade
and posts.blade
files.
Also, in posts.blade
try adding the following right before your include:
- console.log("posts.blade info", __)
and post the output of the console.
Project visible at : git://github.com/vraptor75011/MeteorBladeBlog2.git Here is the output :
Object _id: Object body: "C est un post" createdAt: Sun Apr 07 2013 20:05:43 GMT+1100 (NCT) nbComments: 0 submitted: true title: "Post 1" updatedAt: "" userId: "C79gpCTDdbiiFqAjL" proto: Object posts.js:19posts.blade info ["<$label:5HyqiH632cxatiwJD><$label:yjGPQRcL3WGE2ygBG><$data:LJu8pMXEjPpMNicPR><$landmark:ryCRJGDaWqypbBqrd><$events:XKjrtw79jprCgRGmD><$watch:qi7Nyz8wCMLBqj8mu><$isolate:CExe7ePMaMnxr5xPZ><$events:sNeqo7QYqH9jEY4cu><$watch:RBQgoLo9DjaHZSYRr><$label:TEgmf8vtbuncXNSGg><$label:JbfYiqCZr2gAu9Q2p><$data:xf5d7aQ59qHrsXFoR><$landmark:ctZjz9pFYotakDepk><$events:NEbfT2ppF97nhMRiF><$watch:WwypgsJX7iDcnYdpM><$isolate:9yPfJipqtkrTFR4KF><$events:gqdL8ZLjx4mmnDSLj><$watch:796i5CY4BpizZ6scH>
</$watch:796i5CY4BpizZ6scH></$events:gqdL8ZLjx4mmnDSLj></$isolate:9yPfJipqtkrTFR4KF></$watch:WwypgsJX7iDcnYdpM></$events:NEbfT2ppF97nhMRiF></$landmark:ctZjz9pFYotakDepk></$data:xf5d7aQ59qHrsXFoR></$label:JbfYiqCZr2gAu9Q2p></$label:TEgmf8vtbuncXNSGg><$label:oSZmX5WfbzZiiuaGv><$label:PJnXdjWXLt8WzcN4v><$data:PoNT4toQbPSkWMqzR><$landmark:xBNaEup5aj2nFxd8n><$events:GWyRwandgknADYXxM><$watch:qhhQFR37JsEjqjCAr><$isolate:Pu8tNT6yacJ27wMze><$events:cMBwTByeEZ5JnEGex><$watch:bPjc8GtsGmjxfsNbX>Bonjour
I cannot replicate any bugs... probably because my Mongo DB is empty. Could you provide me with some sample values that I can load into the DB? Or, can you simplify this bug into a simple example that I can run and test?
Thanks for your help.
posts.json
{ "_id" : { "$oid" : "347a0a1a7406a503bddfadc2" }, "body" : "fffff", "createdAt" : { "$date" : 1365901868581 }, "nbComments" : 0, "submitted" : true, "title" : "lllll", "updatedAt" : "", "userId" : "virEdEdkfBwPyafNL" }
{ "_id" : { "$oid" : "3ed9cb73f31b9b4e73d0c800" }, "body" : "C est un post", "createdAt" : { "$date" : 1365325543823 }, "nbComments" : 0, "submitted" : true, "title" : "Post 1", "updatedAt" : "", "userId" : "C79gpCTDdbiiFqAjL" }
{ "_id" : { "$oid" : "9300f568be0d0c2f22c402a5" }, "body" : "zzzz", "createdAt" : { "$date" : 1365326283027 }, "nbComments" : 0, "submitted" : true, "title" : "zzzz", "updatedAt" : { "$date" : 1365326294798 }, "userId" : "C79gpCTDdbiiFqAjL" }
I think it s the same issue as #154
Thanks for your help
Was a bug in my code
I did a mrt update and it appears to break the collection behavior.
It looks like the javascript files of the Meteor projects are loaded but not executed, excepted for those inside client/views.
Is it a bug with meteor-blade or with meteor ?