Unity Issue Tracker - TSS Inspector creates invalid Project Relative paths for USS references in packages when adding References via Inspector
Open
UUM-113640
TSS Inspector creates invalid Project Relative paths for USS references in packages when adding References via Inspector
Unity: UI Toolkit Authoring Framework
Open
6.7.X
6.6.X
6.5.X
6.4.X
6.3.X
6.0.X
Won't Fix
6.2.X
6.1.X
Unity 6000.2 has reached its end of life and will not receive further updates. If you need additional fixes, please upgrade to a newer Unity version.
6000.1 is no longer a supported version of Unity. Please see corresponding 6000.2 port instead (if applicable)
Reproduction steps:
1. Open the attached “IN-107902.zip” project
2. From the Project Window, navigate to TestPackage/Runtime/Resources/UIToolkit/TSS
3. Select the “MainStyle.tss”
4. In the Inspector, in the Style Sheets List, click on the plus to add a new entry
5. Click on the GameObject picker and select the “BaseStyle” Style Sheet
6. Press Apply
7. Move the TestPackage folder fully out of the project
8. Go to the Package Manager
9. Click the plus sign and select “Install package from disk”
10. Select the “package.json” from the moved TestPackage folder and install the package
11. Now navigate to Packages/UI Toolkit Bug Test/Runtime/Resources/UIToolkit/TSS
12. Select the “MainStyle.tss” and observe the Inspector
Expected result: The reference to the “BaseStyle” Style Sheet is not lost
Actual result: The reference to the “BaseStyle” Style Sheet is missing
Reproducible on: Windows 10 (user reported), Windows 11
Not reproducible on: No other environment tested
Notes:
This issue appears to happen due to the fact that selecting a TSS file and using the Inspector to add a USS reference a project relative path is made. Any time a USS files path is changed, all TSS files lose any references to said USS files as the Project Relative path is no longer valid. When developing a Unity package, the paths are different from when the package is installed via the package manager, and so the references are lost
Workaround: Manually editing TSS files to use relative paths (e.g., `../USS/BaseStyle.uss`) instead of Inspector-generated absolute paths resolves the issue for same-package references. However, this workaround fails for cross-package dependencies when multiple packages are developed in a single project, as packages have different paths during development vs installation
Prioritise and Follow this issue
Have a workaround or additional info about this issue?