question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`destinationElement` null or undefined exception

See original GitHub issue
Uncaught (in promise) Error: Assertion Failed: You cannot pass a null or undefined destination element to in-element
    at assert (index.js:172)
    at InElementNullCheckReference.value (index.js:5796)
    at Object.evaluate (runtime.js:2288)
    at AppendOpcodes.evaluate (runtime.js:1571)
    at LowLevelVM.evaluateSyscall (runtime.js:4989)
    at LowLevelVM.evaluateInner (runtime.js:4945)
    at LowLevelVM.evaluateOuter (runtime.js:4937)
    at JitVM.next (runtime.js:5992)
    at JitVM.execute (runtime.js:5964)
    at TemplateIteratorImpl.sync (runtime.js:6124)

There may be other ways to trigger this, but you will definitely see the issue if you use this in conjunction with Ember Power Select. Create a new app and add the following respectively to your application controller and application template

import Controller from '@ember/controller';

export default class ApplicationController extends Controller {
  names = ['One', 'Two', 'Three']
}
<PowerSelect
  @searchEnabled={{true}}
  @options={{this.names}}
  @selected={{this.name}}
  @placeholder="Select some names..."
  @initiallyOpened={{true}}
  @onChange={{fn (mut this.name)}} as |name|>
  {{name}}
</PowerSelect>

@initiallyOpened={{true}} is the issue here. I traced the issue down to this line: https://github.com/cibernox/ember-basic-dropdown/blob/v3.0.17/addon/templates/components/basic-dropdown-content.hbs#L4

this.destinationElement is null at this moment and will throw when attempting to render into ember-basic-dropdown-wormhole DOM element since that is rendering later in DOM ordor (at the end of the page)

I took at stab at updating to ensure destinationElement is populated but not sure if this will cause any additional issues. Perhaps someone with a bit more intimate knowledge here will be able to advise.

  @tracked destinationElement: Element | null;

  constructor(owner: unknown, args: Args) {
    super(owner, args);

    this.destinationElement = null;
    next(() => {
      this.destinationElement = document.getElementById(this.args.destination);
    });
  }

this is related to https://github.com/cibernox/ember-power-select/issues/1354

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jherdmancommented, Oct 6, 2021

Is there a solution outside of @renderInPlace={{true}}?

0reactions
sacarinocommented, May 23, 2022

Ran into this as well. Based on this and https://github.com/cibernox/ember-power-select/issues/1354, I was able to get this workaround going in tests.

<PowerSelect
  // other args
  @initiallyOpened={{false}}
  @renderInPlace={{true}}
  as |stuff|
>
  {{stuff.andThings}}
</PowerSelect>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Console error when making addon component
I'm getting this error when I click on my power-select-multiple on the app ... pass a null or undefined destination element to in-element....
Read more >
Ember "Action passed is null or undefined in (action)" error
Reason for the error is, You are accessing selectDate which is undefined in that scope(ie., controller) If you do {{log 'selectDate value is ......
Read more >
ember-basic-dropdown
I'm seeing the following error when building against Ember Canary: ... Failed: You cannot pass a null or undefined destination element to in-element...
Read more >
Handling null and undefined in JavaScript | by Eric Elliott
In some statically typed languages, you can say that null and undefined are illegal values, and let your programming language throw a TypeError ......
Read more >
Whats does 'Robotic library destination element full error ...
Find answers to Whats does 'Robotic library destination element full error' actually mean? from the expert community ... Avatar of undefined.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found