Pb updating babylonjs

I have this message when I update babylonjs in my project, I don’t understand why

./node_modules/@babylonjs/core/Misc/environmentTextureTools.js 100:39
Module parse failed: Unexpected token (100:39)
File was processed with these loaders:

  • ./node_modules/babel-loader/lib/index.js
    You may need an additional loader to handle the result of these loaders.
    | }

const imageType = options.imageType ?? DefaultEnvironmentTextureImageType;
| const engine = internalTexture.getEngine();

my package.json file contains :
@babylonjs/core”: “^5.24.0”,
@babylonjs/gui”: “^5.24.0”,
@babylonjs/inspector”: “^5.24.0”,
@babylonjs/loaders”: “^5.24.0”,
@babylonjs/materials”: “^5.24.0”,
@babylonjs/procedural-textures”: “^5.24.0”,
@babylonjs/serializers”: “^5.24.0”,
“babylonjs-gltf2interface”: “^5.24.0”,

cc @RaananW

It seems like the babel interpreter you are using doesn’t know the es2021 syntax we are using. In this case it is actually es22020 - @babel/plugin-proposal-nullish-coalescing-operator · Babel

I am not sure about your environment, but if you are already using babel, just make sure to add the right rules to process this syntax

1 Like

I am using typescript & react. target code for ES6

Hi @Stephane_Ancelot,
It looks similar to this

Depending on your toolset you might need to update Webpack or Babel to make it working.