BabylonJS 4.0.3 error after updating

Hello everyone,

I just tried to migrate my project from BabylonJS 3.2 to BabylonJS 4.0.
I used npm install @babylonjs/core to install the latest version of babylon and then imported the modules I needed and tried to build my project. Then I got the error below:

export * from “./abstractScene”;
ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’
Warning: Error running grunt-browserify. Use --force to continue.

Does anyone know why do I get this error ?

Thank you in advance.

Kind Regards,

Summoning @sebavan (please be patient as he will not be available before end of week)

It looks like your build process doesn’t support es6. What bundler are you using?


Thank you for replying to my question.

I am using Browserify.

Thank you in advance.


I do not think it would work with browserify as is as es6 imports might not be recognized. You would need to first transpile then browserify. Knowing babylon is already mostly browser focus and no node syntax need to be translated i would recommend using a bundler like webpack or rollup or parcel in order to create your code which my be simpler to configure than babel + browserify.

Thank you very much for your recommendation.
I really appreciate your answer.

Thank you. :wink:

By the way you could still rely on npm install babylonjs if you do not need modules :slight_smile:

Actually, I need modules in my project.

I really appreciate your answer.

Thanks. :wink: