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.

Undefined Parameter Causes Crash

See original GitHub issue

Broken Code

const { h, app } = hyperapp
/** @jsx h */

const Example = ({a}) =>
	<div>
		Item {a}
	</div>

app({ 
    model: "Hi.", 
    view: model => <div><Example/>this should always render</div>
})

TypeError: undefined is not an object (evaluating ‘node.data’)

Working Code

const { h, app } = hyperapp
/** @jsx h */

const Example = ({a}) =>
	<div>
		Item {a}
	</div>

app({ 
    model: "Hi.", 
    view: model => <div><Example a=""/>this should always render</div>
})

Again, I’m not sure if this is intentional or a bug. Might be nice to show a better error if the ENV isn’t production in case this is intended.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Undefined query parameters causes crash · Issue #55 - GitHub
If you pass an undefined value as a parameter to a query it crashes when trying to bind. Unfortunately with a stack trace...
Read more >
Node JS preventing value undefined crash - Stack Overflow
I have a value that is determined by the user and once that value is entered it checks the corresponding value of that...
Read more >
How to Prevent the Error: Cannot Read Property '0' of Undefined
A guide on how to prevent the error "cannot Read Property '0' of Undefined", covering techniques such as try, catch, using const over...
Read more >
805034 – accessing an undefined variable might cause crash
Cause: When an LDAP entry changed its attributes and was saved again into the SSSD cache, the SSSD might have accessed an undefined...
Read more >
Diagnosing memory, thread, and crash issues early
Code that results in undefined behavior can lead to crashes or incorrect output. In some cases, the code may not result in any...
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