Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outerHTML throws TypeError: arr.forEach is not a function #95

Open
virtualpatterns opened this issue Oct 26, 2020 · 0 comments
Open

outerHTML throws TypeError: arr.forEach is not a function #95

virtualpatterns opened this issue Oct 26, 2020 · 0 comments

Comments

@virtualpatterns
Copy link

virtualpatterns commented Oct 26, 2020

I'm creating an Element using ...

let node = h('a', { 'attributes': { 'href': 'http:www.google.com' } }, 'Google')

... which is the style of hyperscript generated by html-to-hyperscript and html2hscript. When calling outerHTML on this Element ...

console.log(node.outerHTML)

... it throws ...

TypeError: arr.forEach is not a function
    at _stringify (/Volumes/DUMBLEDORE1/Users/fficnar/Projects/Shared Projects/mablung-pug/node_modules/html-element/index.js:291:9)
    at Element.outerHTML (/Volumes/DUMBLEDORE1/Users/fficnar/Projects/Shared Projects/mablung-pug/node_modules/html-element/index.js:336:48)
    at main (/Volumes/DUMBLEDORE1/Users/fficnar/Projects/Shared Projects/mablung-pug/source/sandbox/conv.js:24:22)
    at /Volumes/DUMBLEDORE1/Users/fficnar/Projects/Shared Projects/mablung-pug/source/sandbox/conv.js:32:1
    at ModuleJob.run (internal/modules/esm/module_job.js:140:23)
    at Loader.import (internal/modules/esm/loader.js:165:24)
    at Object.loadESM (internal/process/esm_loader.js:68:5)

Any ideas how to solve this? I suspect it's an html-element issue. If I change { 'attributes': { 'href': 'http:www.google.com' } } to { 'href': 'http:www.google.com' } it works ... but doesn't help since in my use the Element is automatically created from HTML.

@virtualpatterns virtualpatterns changed the title outerHTML throws TypeError: arr.forEach is not a functio outerHTML throws TypeError: arr.forEach is not a function Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant