TLDR; I get an error when using a custom domain binding in Azure, but not when using the default azurewebsites binding. For example https://somewebsite.com do produce the error, while https://somewebsite.azurewebsites.net does not produce the error.
Background info:
In my application I am using Three.js to generate a background on my landing page. I’ve enclosed all the animation code within a component I call <Wave />
which I include in my index.vue.
<Wave />
has only a div, in which I am trying to append a renderer – this works flawlessly in both production and development on my local computer, as well as in production on the default azurewebsites domain binding.
But then when accessing the same app service from a custom binding set up through CloudFlare, the component fails and I get the error saying DOMException: Node.appendChild: Cannot add children to a Text
(This time using Firefox).
This however only happens on a hard reload while accessing the custom binding, if I visit other links inside the app and move back to the route with the <Wave />
component, then it works perfectly.
General concept:
<template>
<div ref="animationContainer"></div>
</template>
<script>
export default {
data() {
return {
container: null,
}
},
mounted() {
this.init()
},
methods: {
init() {
this.container = this.$refs.animationContainer
this.container.appendChild(someRenderer)
},
}
</script>
Which produce the error only in a deployed production using the custom domain binding:
DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.
at Object.appendChild (/_nuxt/0fdd5ad.js:2:41686)
...
I also did try to wrap the <Wave />
component in <ClientOnly>
-tags, but this does not change the error in any way.
Any pointers on where to begin would be greatly appreciated.