I am working on arabic-russian dictionary, editable by users. And I faced an Issue, that I don’t understand.
I’m using blaze. And there is idea of structure:
<ModalForm> <ArticleForm> </ModalForm> <ArticlePage> <ArticlesList> <ArticleSingle><ArticleForm> </ArticlesList> </ArticlePage>
Modal form opens ArticleForm for insert new Article. And then redirects page to new ArticlePage.
ArticlesList wraps couples of . One of them are visible, it depend on editMode parameter. ArticlePage passes array from one article ([articles.findOne]) to ArticlesList.
When I adds first article redirection works fine and page with new Article opens. There is only one ArticlePage template use, with one article instance. Redirection works from after-insert-hook (collections-hooks).
But when I repeat it at second time, there is an error
Exception from Tracker recompute function:
And ArticlePage doesn’t render. And in console I see two ArticlePage calls, first with real data, and second with undefined. I can’t understand, from where appears this “undefined” article. If I reload empty page, it will be rendered well with new article.
This error appears only when i’m trying to redirect from
/articles/yyyy . Redirect from main page
/articles/xxxx works fine even many times.
Here is how it looks.