Why does archiving build not work properly? SwiftUI Xcode 14 iOS 16

Hello I am trying to archive my app to push to testflight but I get errors saying "Cannot Find '[insert file name].swift' in scope".

Building and running on phone works as expected. It is just when I try to archive, there are specific SwiftUI files (that I have created) that cannot be found in scope for whatever reason.

Things I've tried: cleaning, restarting XCode, deleting derived data. I've made sure that all files have the proper target membership for it to be included in the build.

XCode version 14.2; iOS support min 16

Any insight is appreciated, thanks!