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.

Possible Preact 8 regression: Cannot read property 'toLowerCase' of undefined

See original GitHub issue

Looks like it’s during VDOM diffing

Error occurs in isNamedNode https://github.com/developit/preact/blob/52bb91e17a56e6f3dba050c3ae001292b6ff2285/src/vdom/index.js#L27

Stack (bundled) is

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
    at isNamedNode (vendor-bfd2f8511748e755b3c2.js:2619)
    at idiff (vendor-bfd2f8511748e755b3c2.js:2399)
    at innerDiffNode (vendor-bfd2f8511748e755b3c2.js:2502)
    at idiff (vendor-bfd2f8511748e755b3c2.js:2426)
    at diff (vendor-bfd2f8511748e755b3c2.js:2347)
    at renderComponent (vendor-bfd2f8511748e755b3c2.js:1121)
    at renderComponent (vendor-bfd2f8511748e755b3c2.js:1106)
    at setComponentProps (vendor-bfd2f8511748e755b3c2.js:1028)
    at buildComponentFromVNode (vendor-bfd2f8511748e755b3c2.js:1203)
    at idiff (vendor-bfd2f8511748e755b3c2.js:2393)

Let me know if you need more info.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
developitcommented, Apr 8, 2017

Null renders are okay, they don’t throw. This only happens when you render a component with no constructor:

const Okay = () => null;   // all good

let Foo;  // undefined
const NotOkay = () => <Foo />;    // not good - h(Foo) = h(undefined)
1reaction
developitcommented, Apr 7, 2017

Awesome! Yeah sortof an odd bug here.

FWIW I think we’re going to revert the throw here. It’s nice to make people aware of undefined components, but it’s probably a little too harsh to break rendering when encountering them. That plugin is going to find it’s way into a wrapper around preact/devtools, where we’ll be adding a bunch of debugging tips & helpers:

if (process.env.NODE_ENV==='development') {
  // enables devtools & things like undefined component warnings:
  require('preact/debug');
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'toLowerCase' of undefined in react ...
Solved I didn't pass searchText to the table that's why it was giving an error <Table list={list} onDismiss={this.
Read more >
react-select/CHANGELOG.md - UNPKG
The property is now once again named `innerRef`. This is mostly to resolve issues with styled-components not passing `ref` down to wrapped dom...
Read more >
Open Source Used In CBD probe 2.3.x for Raspbian - Cisco
Open Source Used In Cisco Business Dashboard Probe, Version 2.3.x for Raspbian.
Read more >
Cannot read property 'toLowerCase' of undefined - MSDN
Please help me on this error. It seems like i cannot use the 'toLowerCase' function from the javascipt. my codes: /// <reference path="../ ......
Read more >
@netlify/esbuild | Yarn - Package Manager
... operation and the mangled property names likely wouldn't be consistent. ... import {h, Fragment} from "preact"; console.log(h(Fragment, null, h("a", ...
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