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.

Rendering in Node.js throws when using attributes

See original GitHub issue

The following snippet fails:

function SomeView() {
    return function() {
        return ['div#foo', {foo: 'bar'}, 'some text']
    }
}

var vm = domvm.view(SomeView)
vm.mount()
console.log(domvm.html(vm.node))

The rendering routine calls utils.isElem during the process, which causes to throw RefereceError: HTMLElement is not defined. I looked at the code and I see that val instanceof HTMLElement is the root of this error. May be typeof HTMLElement !== 'undefined' or choosing a different strategy for Node.js could solve the problem.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yosbelmscommented, Aug 20, 2016

yeah, aliased “USB Channel”

1reaction
yosbelmscommented, Jul 14, 2016

Thats convergence… regarding I adopt the coding standard of the project I’m contributing to, and the simplicity of the solution, every implementation would looks near identical.

i also beat you […] 😃

Well, I wrote the code yesterday but copied/pasted/pushed this morning to discuss about it, since I have no internet in home 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express Handlebars Won't Render Data - Stack Overflow
I am working with NodeJS and Express using Express-Handlebars template engine. According to the above link: From version 4.6. 0 on, Handlebars ...
Read more >
Render dynamic content in Node.js using templates
In this article, we will see how we can render the front-end using Node.js which is very helpful to display static or dynamic...
Read more >
wont render after hitting a specified route. · Issue #1420 - GitHub
Node.js Version: 9.5.0 OS: mcOS High Sierra 10.13.06 Scope ... express@4.16.3 Hello, I'm having a trouble rendering a template. on my ...
Read more >
Top 10 Most Common Node.js Developer Mistakes - Toptal
Mistake #6: Throwing Errors from Inside Callbacks. JavaScript has the notion of exceptions. Mimicking the syntax of almost all traditional languages with ......
Read more >
Adventures in the Virtual DOM — Part 4: Rendering Attributes
An attribute is something defined in the actual HTML that we would use the JavaScript methods setAttribute and removeAttribute to change.
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