ModuleNotFoundError After Update to babylon 5.0.0 alpha

Hi, gens

I got this webpack error after the update from v4.2 to v5.0
ModuleNotFoundError: Module not found: Error: Can't resolve './abstractScene ' in 'path\node_modules\@babylonjs\core' Did you mean 'abstractScene.js'? BREAKING CHANGE: The request './abstractScene' failed to resolve only because it was resolved as fully specified (probably because the origin is a '*.mjs' file or a '*.js' file where the packag e.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.
I am new to webpack I am not sure what does that means? Version 4.2.0 was working fine before the update, is there anything I need to change in webpack config or package.json to get it working?

Any thoughts would be highly appreciated!

Might be helpful. Else pinging @RaananW :slight_smile:

1 Like

Since babylon.js doesn’t reference the full path of the files it is importing (i.e. the missing .js), webpack needs to be notified it needs to resolve inports differently. To fix that you can set the following flag in your webpack configuration:

babylonjs-webpack-es6/webpack.common.js at master · RaananW/babylonjs-webpack-es6 (github.com)

We hope to resolve this very soon with a new packaging system, but have no actual timeline for that feature

1 Like

Thanks so much for the quick help, that fixes the problem!!

1 Like