Routing chapter
JeffWilkey opened this issue · 1 comments
JeffWilkey commented
So there is an issue with the routing chapter.
The code you guys give for iron router is fine. Except this error stack that shows up in the console
Exception in callback of async function: ReferenceError: EJSON is not defined
at MiddlewareStack.concat (http://localhost:3000/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:303:25)
at RouteController._runRoute (http://localhost:3000/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:542:17)
at Function.Route.dispatch (http://localhost:3000/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:856:18)
at route (http://localhost:3000/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:713:11)
at boundNext (http://localhost:3000/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:425:31)
at Meteor.bindEnvironment (http://localhost:3000/packages/meteor.js?637cc835a2ee4a2302a010c9a4c97b906db5f41c:1007:22)
at dispatch (http://localhost:3000/packages/iron_middleware-stack.js?ff70621b6c5f6a406edc60600c4b76126dae21d6:449:3)
at http://localhost:3000/packages/iron_router.js?dd5fa02859b6335661b94134bd9903be8eecf44d:393:13
at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:357:36)
at new Tracker.Computation (http://localhost:3000/packages/tracker.js?16c53d4f91467c6a41bbb860bf6c48f871710022:245:10)
The fix is meteor add ejson
in the terminal then the template injection will work. I'd suggest adding this to the book.
SachaG commented
Yes, there's been a few threads about this issue already. It's a bug in Iron Router, because of the Meteor 1.2 upgrade. Hopefully it'll be fixed soon.