Platform dependent field serialization

How do you handle fields, whose type is not available on some platforms?
Writing a Wrapper like XR Foundation would be one option but that’s a lot of work.
Using prefabs or scenes that you only save while switched to a compatible platform is error prone.
For references you could just set a GameObject but then you lose type safety.
What other options are there?

There are two major options for that. In simple cases I just omit those fields and their usages with #ifdef#endif preprocessor directives. In more sophisticated case I hide them insode some class and let it habdle the logic instead of just providing data.