1

I've been trying to install babylonjs via npm. I've set up a new project and started with npm init. After that I installed babylonjs with npm install babylonjs --save according to their documentation. Now I created a JavaScript file to import their module using import * as BABYLON from 'babylonjs';. When I open the console it throws me this error: Uncaught SyntaxError: Cannot use import statement outside a module.

Since I'm relatively new to it I'm not quite sure if I'm missing an important step. I don't want to use their CDN, because I won't have access to the internet all the time.

Thanks in advance!

1 Answer 1

1

I would recommend using the es6 packages, which fit better when using es6-style imports.

Here is the documentation:

https://doc.babylonjs.com/features/es6_support

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.