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.

TypeError: undefined is not an object (evaluating 'i.setAttributeNode')

See original GitHub issue

I tried to use datalist-polyfill, but I am getting this error when clicking in a field with a datalist, and nothing is displayed when I type some characters: TypeError: undefined is not an object (evaluating 'i.setAttributeNode') The markup is dynamically created with simple DOM methods. It works fine in non-Safari browsers. I tested with WebKit-based browser Epiphany. <p><datalist id="nml_itemized_categories_datalist"><option value="..."></option>[many other options here]</datalist><input id="nml_itemized_categories_add_input" size="30" class="form-control" list="nml_itemized_categories_datalist"></p> It looks like the polyfill is supposed to create a select inside dataset (from what I can see in the demo, which works), but that select element is never created, and I don’t see any error message about it.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
damien-gitcommented, Nov 1, 2018

Actually, I found that I could avoid this bug by specifying the input type explicitly (“text” is the default type). A simple fix would be to accept a non-existent type attribute as “text”.

0reactions
mfranzkecommented, Nov 5, 2018

@damien-git, totally agreed ! I’ll mention it within the readme.

Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined is not an object (evaluating 'o.data.method ... - GitHub
Affects mostly iOS devices and Safari browsers. TypeError: undefined is not an object (evaluating 'o.data ...
Read more >
TypeError: undefined is not an object (evaluating 'item.name')
This error will occur whenever item is undefined. You can solve this using optional chaining. So wherever you have used item.name === null...
Read more >
TypeError: 'undefined' is not an object (evaluating 'section ...
There was an error with your code: TypeError: 'undefined' is not an object (evaluating 'section.addEventListene. What am I doing wrong?
Read more >
TypeError: setAttribute is not a function in JavaScript
Placing the JS script tag above the code that declares the DOM elements. Calling the setAttribute method on a jQuery object (should use...
Read more >
27/3 - TypeError: undefined is not an object (evaluating 'family ...
Here's the message: TypeError: undefined is not an object (evaluating 'family[i].name') The code outputs the right values to the console, ...
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