How to reproduce:
1. Download the attached “IN-145835_builder” project
2. Make sure to delete the Library and WebGLBuild folders
2. Run the following command in terminal
”/Applications/Unity/Hub/Editor/<UNITY_VERSION>/Unity.app/Contents/MacOS/Unity
-projectPath <path_to_project>/IN-145835_builder
-batchmode
-executeMethod Editor.BuildEntrypoint.CliRunUpmBuild
-logfile <path_to_project>/IN-145835_builder/logs/build.log”
3. Wait for the command to complete
4. Observe log file build.log
Actual result: Build fails when ran via CLI with error "Error building player because script class layout is incompatible between the editor and the player" and a list of random serialisation errors
Expected result: Build completes successfully the same way as building in-editor
Reproducible with: 6000.2.0a8 (6bc6fbc26ac6), 6000.3.19f1, 6000.5.2f1, 6000.6.0b2, 6000.7.0a1
Not reproducible with: 6000.0.78f1, 6000.2.0a7
Reproducible on: macOS 26.5.1 (M1 Pro)
Not reproducible on: No other environment tested
Notes:
- This is only happening when running the command via CLI. You can observe builds completing successfully while opening project and clicking "Builder/UPM StateHandler - Embed and Build"
- Important: After each run delete Library and WebGLBuild folders so there is no caching between runs