element = parent.insertBefore(createElement(node, isSVG), element)
@sam-chuang Thanks for the report! Does this mean we need to check if element is undefined, and then use appendChild instead? 馃
EDIT: Okay, can you check whether element = parent.insertBefore(createElement(node, isSVG), element || null) fixes the issue?
I only tried
element = parent.insertBefore(createElement(node, isSVG), element || null);
And it solve the error on IE 10
@sam-chuang Great! Thanks.
@sam-chuang I found that we call insertBefore in 3 different places, so we actually need to check if the second argument is undefined and make sure to pass null in every case. I think I am going to drop official IE10 support, because I don't have the time or energy to test in IE10.
Hi @JorgeBucaran
Sorry for late response, after look again this issue, I think I found the root cause, refer to line 32
var root = container && container.children[0]
At first, container doesn't have any children, so it's undefined, so I plan to fix it by
var root = (container && container.children[0]) || null
then IE 10 works, if you are feel ok about the code change above, I can create a PR to fix it
@sam-chuang Sounds good, open a PR, please. By the way, would the following also work?
<script type="text/javascript">
var ohNoWeAreOnIE10 = false
/*@cc_on
if (/^10/.test(@_jscript_version)) {
ohNoWeAreOnIE10 = true
}
@*/
</script>
// IE10 crap
if (ohNoWeAreOnIE10) {
container.children[0] = null
}
// Normal world
const main = app(state, view, actions, container)
WOW! Your fix also works on IE 10
But I am confused, your fix since for by app developer who care about IE 10 support, does it means you prefer not to fix inside Hyperrapp src?
@sam-chuang 馃帀
As you know, IE is tricky, maybe the fix you suggest only works in some situation, but maybe we'll find another problem in the future. I'll reopen this issue to track IE related bugs and their fixes here. Then, when we have collected more data we can make a more informed decision.
TL;DR: Please use my fix and let me know if you find another IE10 problem.
Got it, thanks~~
Then I think I need to drop the PR I just created #529
Your fix made it to master. 馃帀
Just by the way: I used to have a version of HyperApp for supporting IE 8.