This question already has an answer here:
I'm aware of the "Heisenberg compensator" plot device to explain how transporters get around the Heisenberg Uncertainty Principle. However, it occurs to me that there is an even more basic (i.e., in terms of classical physics) flaw with their usage: matter spontaneously appearing or disappearing. Wouldn't the sudden infinite pressure differential be, well, problematic to say the least?
Is it ever explained how this is compensated for?
One could imagine that matter is simply swapped betweem the transporter source and destination. However, this still suffers from the same problem; albeit not to the singularity extent. That said, IIRC, transporting into the vacuum of space is a thing.