As no one did a TLDR: if you use a swapfile, it could overwrite part of the the filesystem where the swapfile exist.
Don't use swapfiles if you can. Use a dedicated partition, there are many advantages (including automatic RAID0 if you have a swap partition on each drive)