ManuelDeLeon / viewmodel

MVVM for Meteor
https://viewmodel.org
MIT License
205 stars 23 forks source link

Exception in setTimeout callback #171

Closed avalanche1 closed 8 years ago

avalanche1 commented 8 years ago

I get these on hot code reload image

ManuelDeLeon commented 8 years ago

I don't see it. Make a repro.

avalanche1 commented 8 years ago

Here's a repro: https://github.com/avalanche1/test image

ManuelDeLeon commented 8 years ago

I don't get the error, it reloads fine. Btw the following is an invalid JS object. You can't repeat keys (onRendered)

        T.viewmodel
            load: vmPropsArr
            #works only if the next onRendered is commented out
            onRendered: ->alert "Im working only if I'm the only 'onRendered'"
            onRendered: ->alert "Im working always - yay!"
avalanche1 commented 8 years ago

Thanks for the notice! But it's rather strange that u dont get those errors on HCR. I get them even here, where there is almost none atmosphere packages installed (which might have caused a collision of some sort) Maybe that is because I install viewmodel in atypical way - into packages folder (remember, I couldn't install nothing younger than 1.9.3 because I had dependecy resolution probs in meteor v1.1?) - you can see it in the repo. Could you install viewmodel as a package and test for errors?

ManuelDeLeon commented 8 years ago

I pretty much always use ViewModel from a folder. I sometimes get the "could not create unique identifier" error when I'm working on the markup and ViewModel gets "confused" as to which saved data goes where but it's solved with a refresh. It's not something I can reproduce though.