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.

Dropdown remote getting type error: e is null

See original GitHub issue

Help Wanted

Problem

I am trying to get populate a dropdown with remote data using the api, but no matter what I try, the console always shows: TypeError: e is null

My backend is Django. I’ve tried returning what Django returns doing a ‘.all()’ query and fixing the response in an onResponse call in my js, but this didn’t work. I’ve also tried creating the correct format in Django and returning JSON of the correct form (according to this) but I get the same error. An example of the response from my server is:

{
  "success": true,
  "results": [
    {
      "name": "Adafruit",
      "value": 1
    },
    {
      "name": "SparkFun",
      "value": 2
    }
  ]
}

And here is the relevant javascript:

    $('#manufacturer').dropdown({
        apiSettings: {
            debug: true,
            cache: false,
            action: 'get manufacturer list',
        },
    });

The debug output shows all the steps are completing succesfully:

... Changing setting ...
... Looking up url for action ...
... Querying URL ...
... Throttling request ...
... Sending throttled request ...
... Checking JSON returned success ...
... Response passed success test ...
... Successful API Response ...

With the final step showing my response in the correct form.

The exact error message is:

TypeError: e is null[Learn More] semantic.min.js:11:86696

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lubber-decommented, Feb 21, 2019

@cafeclimber Then my guess with the empty select was correct 😄

0reactions
cafeclimbercommented, Feb 21, 2019

It was! Lol thanks for the help and the PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery Draggable with Bootstrap Tooltip TypeError
I have a draggable element (see the code snippet and click on picture to add pins) which shows a tooltip on mouseover and...
Read more >
Methods | Select2 - The jQuery replacement for select boxes
Methods · Opening the dropdown · Closing the dropdown · Checking if the plugin is initialized · Destroying the Select2 control · Examples....
Read more >
JavaScript Drop Down Box Configuration - DevExtreme
Specifies whether the UI component allows a user to enter a custom value. Type: Boolean. Default Value: false. accessKey.
Read more >
Error Responses - Amazon Simple Storage Service
Lists and describes the Amazon S3 error responses and their associated HTTP status codes.
Read more >
Uncaught TypeError: e is null - error when saving edit event ...
Uncaught TypeError: e is null - error when saving edit event Completed · Edit an event with the following conditions. start & end...
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