Closed nullrocket closed 6 years ago
@nullrocket I’m experiencing this same issue. Could you kindly explain how you integrated the fix for #16503 into your project? I’d like to start digging into this but I’m not sure how to get a local version on the VM connected to my project.
Edited
I have a reproduction now, I am pretty sure it is related to usage of the {{component}} helper in an {{each}} block
After reading @willviles comment in https://github.com/emberjs/ember.js/issues/16503 I went back and simplified my reproduction some more, it doesn't take a {{component}} or {{each}} to reproduce as I initially thought. I removed the each and just pasted in a large number of components to simulate the number being rendered in the each I had previously set up.
The reproduction transitions between two routes with this template in each route, after some number of transitions it will throw the error. Currently it throws the error I'm experiencing in this issue but if you switch ember-source to 3.1.0 you can duplicate the error for https://github.com/emberjs/ember.js/issues/16503
{{my-component text=item}}
{{my-component text=item}}
... about 600 more
@nullrocket thanks I found the caching issue with this, while the template and its handle is cached properly after the routes are first visited, the definition is given a new handle every lookup.
It is worse, that issue only affects dynamic lookup via component helper, your reproduction is something else, I assumed that every compilable template stayed in a compiled state because all of them do but WrappedBuilder which handles components with a tagName in Ember. Meaning that every invoke of a component with a tag is regenerating all the opcodes, which is why you are hitting this limit.
https://github.com/emberjs/ember.js/pull/16557 bumped glimmer-vm to include a related fix, whcih was cherry-picked to beta in 9a88250 and to release in 1e55a63 (though release branch is actually on glimmer-vm v0.32.6).
Builds should be published for all channels (release, beta, and canary) soon. To test you can use:
npm install --global ember-source-channel-url
ember-source-channel-url release
Then update ember-source
in your package.json
to point at the tarball URL printed out from that command.
@krisselden - Would you mind reviewing and confirming that this is ultimately resolved (and close)?
@krisselden @rwjblue I ran it through a about 5k iterations of my reproduction and it seems to be fixed for me. No errors and no memory / heap growth.
Thanks for the fast work on this today!
Closing this issue as the underlying bug has been fixed (and confirmed with the demo repos provided). The fix for this has been pulled into release (for 3.1.x release) and beta (for 3.2.0-beta.x release). The latest builds (in 10-15 minutes) to the release, beta, and canary channels should include the fix (you can get the latest tarball URL via ember-source-channel-url).
If additional issues crop up, we should report as a new issue with a reproduction.
After the fix for https://github.com/emberjs/ember.js/issues/16503 I updated from 3.0.0 and I am seeing this after a couple route transitions instead of the previous. I can't reproduce except in this application.