Brave build crashes PC about midway through

After getting brave source code and using npm run init, I run npm run build to build Brave (on Windows). It goes pretty well for the majority of the build up until around 45000/63401, where the memory (16gb) maxes out, my laptop starts lagging and in a couple minutes time it crashes and causes a BSOD on my laptop. The error message varies, a few examples being DRIVER_POWER_STATE_FAILURE, VIDEO_SCHEDULER_INTERNAL_ERROR and DPC_WATCHDOG_VIOLATION. When I continue the build until it finishes after many blue screens, brave boots up to the welcome screen and freezes, becoming unresponsive. To my knowledge it shouldn’t be a performance issue since I’ve built Chromium on this laptop many times before. If it helps, I am running an AMD Ryzen 7 6800H, 16gb 4800MHz DDR5 RAM, RTX 3050 laptop GPU and prior to downloading the Brave source code, I had about 230/500GB free space. How can I fix this and successfully build Brave browser?

All of these point to you needing to update drivers and/or run malware scans.