If you use "if !browser" with sveltes browser object, the things inside that branch will only run on the server.
But because svelte is compiled, these functions get compiled to two different versions, one for the server and one for the client, in which that if statement has been completely compiled out. That in itself isn't bad but it's weird that normal code and control flow influences compilation. In other languages this would be a macro or something that clearly expresses that it's metaprogramming.
Then there are some other weird things like props being merged and potentially overwriting each other in a deep level. But that is by design and can be reasoned about.
What also felt weird to me is that there is no recommended way to do initialization logic such as reading in a config, reading from the environment and preparing something for the rest of the lifetime of the application.
Has anyone had similar experiences/confusions when learning SvelteKit?