Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

180
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda