Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!