Yes, I have this issue with 5.0.0-rc.13
. To clarify, the webpack default is true. I’m fixing it with the above patch that I apply to my local version of webpack that changes the webpack default to false.
Anybody using create-react-app’s inbuilt react-scripts package with 3,302,303 weekly downloads will have this issue, and can only solve it either via ejecting the webpack config (a massive pain in the butt, I don’t want to manage the webpack config myself, it’s why I’m using create-react-app) or by patching react-scripts/webpack, which is also a pain to do.
Imo, it’s also a bad user experience for anyone even without react-scripts to have to modify their webpack config to get it to compile with babylonjs
Given how the change is a one liner and there seems to have been relatively extensive discussion on webpack 5.0.0-beta.30 Module not found: Error: Can't resolve '../../core-js/object/define-property' · Issue #11467 · webpack/webpack · GitHub it seems unlikely it will be changed without significant pushback from major libraries
Related threads on the typescript repo: Provide a way to add the '.js' file extension to the end of module specifiers · Issue #16577 · microsoft/TypeScript · GitHub Provide a way to add the '.js' file extension to the end of module specifiers · Issue #16577 · microsoft/TypeScript · GitHub
It’s not clear to me what the solution would be for you to fix it on bjs side (can you put .js on your filenames as the typescript threads suggest?)
For reference the 223 errors I’m getting are like those mentioned in the OP
It does seem like you’re pretty committed to ES modules, but if I were you, I would abandon the disaster that they are. In the past I spent several hours trying to get Bjs in headless mode to run on my server in node (replicating animations etc is practically required for fully server authoritative games) and ended up giving up. I couldn’t use module: ESNext
in my tsconfig as I would then have to be an es module myself (which I cannot do because ESM doesn’t support features I require), and I couldn’t use module: commonjs
and then import a ESM library.
I think this thread sums up the problems with them pretty nicely: ES Modules are terrible, actually · GitHub
A big reason to use babylon.js over three.js is because its lack of breaking changes is supposed to save developer time. This is doing the complete opposite!