Manuel:viewmodel broken with latest updates?

Is anyone having problems with viewmodel and latest updates? After updating a Meteor 1.2 project to 1.4.2 a few weeks back. all was working fine. Today decided to upgrade (meteor update --patch) to 1.4.2.7 and all continued to work fine. Then did a plain meteor update that updated a few packages:

This project is already at Meteor 1.4.2.7, the latest release.

Changes to your project s package version selections from updating package versions:

babel-compiler    upgraded from 6.13.0 to 6.14.1
check             upgraded from 1.2.4 to 1.2.5
ddp-client        upgraded from 1.3.2 to 1.3.3
ddp-server        upgraded from 1.3.12 to 1.3.13
ecmascript        upgraded from 0.6.1 to 0.6.3
launch-screen     upgraded from 1.1.0 to 1.1.1
logging           upgraded from 1.1.16 to 1.1.17
minifier-css      upgraded from 1.2.15 to 1.2.16
minimongo         upgraded from 1.0.19 to 1.0.20
modules           upgraded from 0.7.7 to 0.7.9
modules-runtime   upgraded from 0.7.8 to 0.7.9
mongo             upgraded from 1.1.14 to 1.1.15
observe-sequence  upgraded from 1.0.14 to 1.0.15
tracker           upgraded from 1.1.1 to 1.1.2
webapp            upgraded from 1.3.12 to 1.3.13

and kaboom. It appears to point to manuel:viewmodel, but not sure since there was no update to the package. I have create a very minimal repro of the issue, in case anyone has a few spare cycles to have a look. broke in the last commit. @manuel ?

Forgot to post the console message:

Uncaught Error: {{#each}} currently only accepts arrays, cursors or falsey values.
    at badSequenceError (observe-sequence.js?hash=14ae414ā€¦:174)
    at observe-sequence.js?hash=14ae414ā€¦:139
    at Object.Tracker.nonreactive (tracker.js?hash=9f8a0ceā€¦:631)
    at observe-sequence.js?hash=14ae414ā€¦:116
    at Tracker.Computation._compute (tracker.js?hash=9f8a0ceā€¦:339)
    at new Tracker.Computation (tracker.js?hash=9f8a0ceā€¦:229)
    at Object.Tracker.autorun (tracker.js?hash=9f8a0ceā€¦:604)
    at Object.observe (observe-sequence.js?hash=14ae414ā€¦:113)
    at Blaze.View.<anonymous> (blaze.js?hash=813922cā€¦:2819)
    at fireCallbacks (blaze.js?hash=813922cā€¦:2013)

tx

Itā€™s a regression: https://github.com/meteor/meteor/commit/ffd0a50f9487a0a9ffd7b6b415991c2022bf86fe

It should be checking for seq instanceof Array || _.isArray(seq)

EDIT: I still need to do a few tests to confirm it. Will check after Meteor is done updating. I canā€™t believe they havenā€™t fixed their update mechanism so it doesnā€™t take forever (Itā€™s been almost 2 years now).

Yep, it works if you monkey patch underscore: _.isArray = function(arr) { return arr instanceof Array };. I left a comment on that commit.

2 Likes

yeah, thanks for following it up. I guess it would be a matter of time before we had more complainsā€¦ I will pin observe-sequence to 1.0.14 until fixed.

Hi Manuel! I ran into this issue too, but am not really familiar with the answer youā€™re proposing. How do I ā€œmonkey patch underscoreā€ properly?[quote=ā€œmanuel, post:4, topic:34106ā€]
monkey patch underscore: _.isArray = function(arr) { return arr instanceof Array };
[/quote]

Thanks for your nice work!

Donā€™t touch underscore (Manuel was just proving his reasoning). Just revert package observe-sequence to version 1.0.14.

2 Likes

Any news on this? Iā€™m running in to same issue and will follow the advice to revert observe-sequence. But an official fix would be nice!

(Edit: Okay, having issues with reverting the package evenā€¦

meteor add observe-sequence@=1.0.14
 => Errors while adding packages:

While selecting package versions:
error: No version of observe-sequence satisfies all constraints: @=1.0.14, @1.0.15
Constraints on package "observe-sequence":
* observe-sequence@=1.0.14 <- top level
* observe-sequence@1.0.15 <- top level
* observe-sequence@1.0.12 <- blaze 2.1.8 <- accounts-base 1.2.14 <- accounts-password 1.3.4
* observe-sequence@1.0.12 <- blaze 2.1.8 <- blaze-html-templates 1.0.1-anubhav.0
* observe-sequence@1.0.12 <- spacebars 1.0.12

Unfortunately itā€™s a Meteor issue which has to go through the normal (read: slow) fix and release process.

1 Like

Thanks for the response.

Any idea how I could temporarily get observe-sequence reverted? It seems attempting to with 1.0.14 is not working (as pasted above).

Dunno, my recommendation is to not update the Meteor version of the app until the fix gets out.

@hluz - If you could share how you reverted your package it would be greatly appreciated! Stuck with this issue right now and as pasted above, I am not able to get a revert to work.

In your projectā€™s .meteor/versions file, set the line observe-sequence@1.0.15 to observe-sequence@1.0.14. Save.

Performed this and no luckā€¦ still getting

Error: {{#each}} currently only accepts arrays, cursors or falsey values.
    at badSequenceError (observe-sequence.js?hash=14ae414ā€¦:174)
    at observe-sequence.js?hash=14ae414ā€¦:139
    at Object.Tracker.nonreactive (tracker.js?hash=9f8a0ceā€¦:631)
    at observe-sequence.js?hash=14ae414ā€¦:116
    at Tracker.Computation._compute (tracker.js?hash=9f8a0ceā€¦:339)
    at new Tracker.Computation (tracker.js?hash=9f8a0ceā€¦:229)
    at Object.Tracker.autorun (tracker.js?hash=9f8a0ceā€¦:604)
    at Object.observe (observe-sequence.js?hash=14ae414ā€¦:113)
    at Blaze.View.<anonymous> (blaze.js?hash=813922cā€¦:2819)
    at fireCallbacks (blaze.js?hash=813922cā€¦:2013)

This page worked perfectly prior to 1.4 updateā€¦ and we need 1.4 for newer node version to support a NPM package that we require in our projectā€¦

Any assistance on this issue would be appreciated!

(Edit: It seems it is automaticallly updating the version?

I noticed after editing it multiple times it is going back to version 15, and I see this in console:

Changes to your project's package version selections:

observe-sequence  upgraded from 1.0.14 to 1.0.15

Any ideas?

Specify the version like this: observe-sequence@=1.0.14

If you mean in the versions file, this throws an error if I use @=.

If you mean when attempting a Meteor add, or if I add the line you posted to packages file, the result is:

meteor add observe-sequence@=1.0.14
 => Errors while adding packages:

While selecting package versions:
error: No version of observe-sequence satisfies all constraints: @=1.0.14, @1.0.15
Constraints on package "observe-sequence":
* observe-sequence@=1.0.14 <- top level
* observe-sequence@1.0.15 <- top level
* observe-sequence@1.0.12 <- blaze 2.1.8 <- accounts-base 1.2.14 <- accounts-password 1.3.4
* observe-sequence@1.0.12 <- blaze 2.1.8 <- blaze-html-templates 1.0.1-anubhav.0
* observe-sequence@1.0.12 <- spacebars 1.0.12

Very frustratingā€¦

@Spyridon, you appear to have some contradicting references to versions of the packageā€¦ could you please check that you check for duplicate referencesā€¦ ensure that you:

  • Have no line for observe-sequence in .local/packages
  • Have only one line in .local/versions specifying 1.0.14
  • Donā€™t do a meteor update after changing the versions file

I have projects running 1.4.2.3 with observe-sequence@1.0.14 without any issuesā€¦

1 Like

Thanks again for the response.

  1. Just one line in packages.

Also, during removal I ensured there was none at all.

  1. Yes, same in versions file.

  2. Have not been doing meteor update after changing. It seems as soon as I start my application, the line about ā€œChanges to your projectā€™s package version selectionsā€ appears.

Not sure why the package version keeps automatically updating.

Here is the output from attempting to update versions file and starting server again:

=> Started proxy.
=> Started MongoDB.

Changes to your project's package version selections:

observe-sequence  upgraded from 1.0.14 to 1.0.15

=> Started your app.

=> App running at: http://localhost:3000/

You got me stumpedā€¦

There should be no need to mention the package at all in the packages fileā€¦ (no need to do meteor add observe-sequence) and versions file should have observe-sequence@1.0.14

what Meteor release are you at? Are you using any local packages?

1 Like

Release: Meteor 1.4.3.1

No local packages, just some atmosphere/npm (pretty standard ones).

Based upon your input just now, I removed observe-sequence. At that point, it was no longer in packages file, and observe-sequence@1.0.15 was still in there.

So I updated to 1.0.14. When I start server, same exact thing happens:

observe-sequence upgraded from 1.0.14 to 1.0.15

Any ideas what is automatically upgrading the package??