I have created a simple Javascript block of code in my HTML script, I am trying to load the newly created Pixi App but I get an error: "Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. at window.onload (index.html:18:26)"
Here's the block of code:
<script>
window.onload = function() {
let app = new PIXI.Application <HTMLCanvasElement> ({
width: 800,
height: 600,
background: '#1099bb'
});
document.body.appendChild(app.view); //THIS IS THE ROOT OF THE ERROR
}
</script>
I'm using PixiJS version 7.4.0 and the program runs fine when I do any other Javascript code like adding elements or changing innerText.
I have made sure PixiJS version and the PixiJS library version match.
try this: