Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
Resize error while using babylon.js by cdn

I'm just got to know about babylon.js and started to try it out. I follow this youtube video for beginners. I used CDN for using babylon.js as https://cdn.jsdelivr.net/npm/babylonjs@4.2.0/babylon.js.

This is the program i typed 👇

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    body {
        margin: 0;
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }

    canvas {
        width: 100%;
        height: 100%;
    }
</style>

<body>
    <canvas id="renderCanvas"></canvas>
    <script src="https://cdn.jsdelivr.net/npm/babylonjs@4.2.0/babylon.js"></script>
    <script>
        const canvas = document.getElementById("renderCanvas");
        const engine = BABYLON.Engine(canvas, true);
        function createScene() {
            const scene = new BABYLON.Scene(engine);
            const camera = new BABYLON.FreeCamera('camera', new BABYLON.Vector3(0, 0, 0), scene);
            const light = new BABYLON.HemisphericLight('light', new BABYLON.Vector3(0, 1, 0), scene);
            return scene;
        }
        const scene = createScene();
        engine.runRenderLoop(()=>{
            scene.render();
        })
    </script>
</body>

</html>

When i run the program this error is shown in the console 👇

Uncaught TypeError: this.resize is not a function
    at Module.e (babylon.js:16)
    at Module.t (babylon.js:16)
    at index.html:29

How should i resolve this issue?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda