It did not. You can check the log below - the two commands you mentioned work well. The problem is only with βnpx nx build coreβ.
And the problem is that the build system searches for β¦/β¦/β¦/β¦/β¦/β¦/tslib.es6.js, and it is outside of the Babylon source folderβ¦
Under Linux, there are no such problems; on Windows 11, it is present; on Mac, there is another problem step before - the build script generates a binary file β.bin/build-toolsβ and does not mark it executable, so MacOS prevents the next stepsβ¦
PS D:\viewers\babylonjs\src\Babylon.js> npm run build:source:lts
> @babylonjs/root@1.0.0 build:source:lts
> npx nx run-many --target=compile --projects=@lts/core,@lts/gui,@lts/loaders,@lts/materials,@lts/post-processes,@lts/procedural-textures,@lts/serializers --parallel=1
β nx run @lts/core:compile (2s)
β nx run @lts/gui:compile (2s)
β nx run @lts/loaders:compile (2s)
β nx run @lts/serializers:compile (2s)
β nx run @lts/materials:compile (2s)
β nx run @lts/post-processes:compile (2s)
β nx run @lts/procedural-textures:compile (2s)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> NX Successfully ran target compile for 7 projects (13s)
PS D:\viewers\babylonjs\src\Babylon.js> npm run build:dev
> @babylonjs/root@1.0.0 build:dev
> npm run build:assets && npm run build:source && npm run build:declaration -w @tools/babylon-server
> @babylonjs/root@1.0.0 build:assets
> build-tools -c pa --global
Babylon.js build tools
Command: pa
Processing assets from ./packages/**/*/src/**/*.+(png|jpg|jpeg|gif|svg|scss|css|html|json|fx)
> @babylonjs/root@1.0.0 build:source
> tsc -b ./tsconfig.devpackages.json
> @tools/babylon-server@1.0.0 build:declaration
> build-tools -c pud --config ./declarationConfigDev.json
Babylon.js build tools
Command: pud
IPhysicsEnginePlugin as IPhysicsEnginePluginV1
IPhysicsEnginePlugin as IPhysicsEnginePluginV1
IPhysicsEnginePlugin as IPhysicsEnginePluginV1
aliasing PhysicsEngine as PhysicsEngineV2
aliasing TouchHolographicButton as TouchHolographicButtonV3
IGLTFLoaderExtension as IGLTFBaseLoaderExtension
PS D:\viewers\babylonjs\src\Babylon.js> npx nx build core
β 3/3 dependent project tasks succeeded [1 read from cache]
Hint: you can run the command with --verbose to see the full dependent project outputs
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> nx run core:build
> @babylonjs/core@6.42.0 build
> npm run clean && npm run compile
> @babylonjs/core@6.42.0 clean
> rimraf dist && rimraf *.tsbuildinfo && rimraf "./**/*.!(cmd|md|json|build.json|lts.json|cjs)"
> @babylonjs/core@6.42.0 compile
> tsc -b tsconfig.build.json && tsc -b tsconfig.lts.json
> @babylonjs/core@6.42.0 postcompile
> build-tools -c declarations-es6 -r ../../../dev/core/src/LibDeclarations -atf ./Engines/engine.d.ts && build-tools -c add-js-to-es6 && build-tools -c prepare-es6-build -cf Engines/constants.js
Babylon.js build tools
Command: declarations-es6
Declarations ES6: root: ../../../dev/core/src/LibDeclarations append to file: ./Engines/engine.d.ts
Babylon.js build tools
Command: add-js-to-es6
No path specified, using default: ./**/*.js
Adding .js extensions to files in ./**/*.js
./BakedVertexAnimation/bakedVertexAnimationManager.js D:\viewers\babylonjs\src\tslib.es6.js
D:\viewers\babylonjs\src\Babylon.js\packages\dev\buildTools\dist\addJSToCompiledFiles.js:26
throw new Error(`File ${match[1]} does not exist. Are you importing from an index/directory?`);
^
Error: File ../../../../../../tslib.es6.js does not exist. Are you importing from an index/directory?
at D:\viewers\babylonjs\src\Babylon.js\packages\dev\buildTools\dist\addJSToCompiledFiles.js:26:23
at Array.forEach (<anonymous>)
at addJsExtensionsToCompiledFiles (D:\viewers\babylonjs\src\Babylon.js\packages\dev\buildTools\dist\addJSToCompiledFiles.js:17:11)
at addJsExtensionsToCompiledFilesCommand (D:\viewers\babylonjs\src\Babylon.js\packages\dev\buildTools\dist\addJSToCompiledFiles.js:42:9)
at runCommand (D:\viewers\babylonjs\src\Babylon.js\packages\dev\buildTools\dist\index.js:34:85)
at Object.<anonymous> (D:\viewers\babylonjs\src\Babylon.js\packages\dev\buildTools\dist\index.js:25:1)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
Node.js v20.10.0
npm ERR! Lifecycle script `compile` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @babylonjs/core@6.42.0
npm ERR! at location: D:\viewers\babylonjs\src\Babylon.js\packages\public\@babylonjs\core
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @babylonjs/core@6.42.0
npm ERR! at location: D:\viewers\babylonjs\src\Babylon.js\packages\public\@babylonjs\core
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
> NX Ran target build for project core and 3 task(s) they depend on (55s)
Γ 1/4 failed
β 3/4 succeeded [1 read from cache]
PS D:\viewers\babylonjs\src\Babylon.js>
I found the issue, node found some modules already installed in the top level folders outside babylon source folder, and node decide that it is okayβ¦
I donβt understand what the fix was here @forux. Can you explain what it is you did to get it working? I am having the exact issue you describe here.
I am not sure why, but babylon build can lose path if you have a node_modules folder in parent directories. The best is to put babylon folder in the top level so there will be no node_modules folders