Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

each with an undefined element and key blows up #20786

Open
boris-petrov opened this issue Oct 30, 2024 · 2 comments
Open

each with an undefined element and key blows up #20786

boris-petrov opened this issue Oct 30, 2024 · 2 comments

Comments

@boris-petrov
Copy link
Contributor

🐞 Describe the Bug

See the reproduction below.

🔬 Minimal Reproduction

{{#each (array undefined) key="anything"}}{{/each}}

😕 Actual Behavior

Exception:

Uncaught (in promise) Error: boundsList cannot be empty
    at debugAssert (ember.js:511:1)
    at LiveBlockList.finalize (ember.js:6350:1)
    at NewElementBuilder.popBlock (ember.js:6329:1)
    at VM.execute (ember.js:6711:1)
    at TryOpcode.handleException (ember.js:6669:1)
    at UpdatingVMFrame.handleException (ember.js:6687:1)
    at UpdatingVM.throw (ember.js:6668:1)
    at Assert.evaluate (ember.js:6358:1)
    at UpdatingVM._execute (ember.js:6668:1)
    at ember.js:6665:1
    at debug$1.runInTrackingTransaction (ember.js:1360:1)
    at UpdatingVM.execute (ember.js:6665:1)
    at RenderResultImpl.rerender (ember.js:6687:1)
    at ember.js:14367:1
    at RootState.render (ember.js:14363:1)
    at ember.js:14398:1
    at inTransaction (ember.js:6494:1)
    at Renderer._renderRoots (ember.js:14391:1)
    at Renderer._renderRootsTransaction (ember.js:14403:1)
    at Renderer._revalidate (ember.js:14405:1)
    at invoke (ember.js:3200:1)
    at Queue.flush (ember.js:3195:1)
    at DeferredActionQueues.flush (ember.js:3214:1)
    at Backburner._end (ember.js:3244:1)
    at Backburner._boundAutorunEnd (ember.js:3221:1)

🤔 Expected Behavior

No error.

🌍 Environment

  • Ember: 5.12.0
  • Ember-CLI: 5.12.0
  • Node.js/npm: v23.1.0
  • OS: Linux
  • Browser: N/A
@Mudavath-Giri-Naik
Copy link

Hello @boris-petrov, can i work on this , since this is my first contribution

@NullVoxPopuli
Copy link
Contributor

I couldn't reproduce this in glimmer-vm, so I think it's a bug here: https://github.com/emberjs/ember.js/blob/main/packages/%40ember/template-compiler/lib/plugins/transform-each-track-array.ts#L26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants