We have recently seen an issue where yarn build is failing with error Cannot read properties of undefined (reading 'has'). This is caused because of a external dependency "glob" that released a breaking change, To mitigate this issue, please add a resolution for glob version 7.2.0 in the package.json file of your deployable package
Update:
Glob has released a newer package 7.2.3 which fixes the issue introduced by 7.2.2. With this change, you no longer need to add the resolution for 7.2.0