chore: use typeof window
checks for removing server code
#27514
Merged
typeof window
checks for removing server code
#27514