I’m trying to run the playground locally. I get the following issue running npm install (version 8.1.2, nodejs 16.13.2, Windows 11) on the root folder (its at tags/5.34.0).
Normally I never ask a question about compilation but… what did I do wrong?
node.decorators comes directly from typescript; this is why I was asking that. I just made a fresh install to be sure it is still working. Was there any error during dependency installation?
I still get endless compilation errors whenever I touch something Babylon.js; I must have spent 100-200 hours on it in the last year. I’m rather cynical at this point, but still desperate for a 3D + XR solution for our application that will work on the web, mobile and desktop.
I now tried again.
I had to google how to build Babylon.js since buildSystem.md is not referenced in the readme.
I followed the instructions to run the playground (in my earlier attempt I just ran something like npm run build in the main and playground directories).
git clone https://github.com/BabylonJS/Babylon.js.git
cd Babylon.js
npm run watch:dev
npm run serve -w @tools/babylon-server
'webpack' is not recognized as an internal or external command,
operable program or batch file.
...
npm i -g webpack (not mentioned in the documentation)
npm run serve -w @tools/babylon-server
Error: Cannot find module 'webpack-cli/package.json'
...
npm i -g webpack-cli (not mentioned in the documentation)
npm run serve -w @tools/babylon-server
[webpack-cli] Failed to load 'C:\Users\frank\repos\Babylon.js\packages\tools\babylonServer\webpack.config.js' config
[webpack-cli] Error: Cannot find module 'C:\Users\frank\repos\Babylon.js\node_modules\@dev\build-tools\dist\index'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:353:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\frank\repos\Babylon.js\packages\tools\babylonServer\webpack.config.js:3:20)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
code: 'MODULE_NOT_FOUND',
path: 'C:\\Users\\frank\\repos\\Babylon.js\\node_modules\\@dev\\build-tools\\package.json',
requestPath: '@dev/build-tools'
The dist folder does not exist.
I actually wanted to contribute to Babylon.js but it’s just absolutely hopeless and depressing.
I’m sorry to hear that, but we’ve recently made many changes to the documentation in order to make it easier to find information such as how to contribute. We moved the Start Contributing to Babylon.js | Babylon.js Documentation (babylonjs.com) section to be easier to find with instructions on how to get the project building.
Have you run the command npm install on the top level Babylon.js folder, as asked for in the documentation?
Oh, thanks for letting me know, they’re using old names, I’m going to update it You can use the Lauch Playground Task
EDIT: oh my bad, going through it again, it’s because “Playground Serve” is a task, but “Launch Playground” is the name of the launch configuration that runs the task. I think it makes more sense to only mention the launch configuration names on the documentation as that’s what we mainly interact with in VS Code, so I’ll definitely update the docs
Thanks; I also managed to run the native Windows playground without issues.
Babylonjs-react-native for Windows is a very different story, but since it doesn’t have support for input or debugging anyway, I guess I’ll just have to wait until that matures. I already reported the issues.