melte icon indicating copy to clipboard operation
melte copied to clipboard

Trackers not working as intended

Open tbelmar opened this issue 3 years ago • 4 comments

Hey!

I'm working on a meteor project that makes use of zodern/melte's $m functionality. We use Meteor sessions to set and get information about toasts so the app can appropriately display them. We have the following reactive block, which from my understanding should keep track of when the session variables change, but does not.

image

This reactive block does not run when the session variables change as intended.

When I change the reactive block to a Tracker.autorun block, it works completely fine and as intended. My understanding was that $m and Tracker.autorun should have the exact same behavior.

Additionally, if I self-reference the above variables like so it also fixes the issue: image

It's worth pointing out that this has happened in other places in our app, namely with subscriptions to Meteor publications, but this was the simplest example I could come by.

These reactive blocks were not causing this issue a couple of months ago (I remember them working around the middle of September, but I'm unsure of when they stopped working).

Please let me know if you need any more information. Thanks!

tbelmar avatar Nov 15 '22 00:11 tbelmar

Same issue for me. I am migrating a Blaze app (maybe that is important to say?). At first it was working fine I think, but eventually the reactivity stopped working. Zodern told me to investigate the transpiled code in .meteor/local/build/programs/web.browser/app/app.js . I haven't had time to do it yet. Re-referencing the variable in the block helps. I ended up using svelte-meteor-data's useTracker instead (not as nice syntax though).

tosinek avatar Nov 30 '22 11:11 tosinek

Removing svelte-meteor-data seems to be fixing the issue. Could you please try that?

tosinek avatar Dec 04 '22 19:12 tosinek

Removing svelte-meteor-data seems to be fixing the issue. Could you please try that?

This worked for me. 👍 meteor remove rdb:svelte-meteor-data

csellis avatar Mar 02 '23 13:03 csellis

Also confirming that this works for me!

vpalos avatar Jun 08 '23 17:06 vpalos