Jump to content

BabylonJS with ES6, Webpack, React & Electron


Recommended Posts


Can anyone recommended a method for integrating Babylon into a an electron app, built with Webpack, using React/Redux?

When I import Babylon either as an inline script in head or as an ES6 import, I get the same error which i assume is connected to Electron.

I've attached an image of the top of the stack trace and the line in babylon that errors is the this.resize(); as per below;

var limitDeviceRatio=options.limitDeviceRatio||window.devicePixelRatio||1.0;this._hardwareScalingLevel=adaptToDeviceRatio?1.0/Math.min(limitDeviceRatio,window.devicePixelRatio||1.0):1.0;this.resize();//

Any ideas greatly appreciated.



Link to comment
Share on other sites

Something is screwing the code of babylon.js

"this" in this context should be the engine. There is something wrong when you reference the framework


As you can see, the code is correct. Sounds like the context is changed by Electron?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...