internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:192: MapViewOfFileEx: Attempt to access invalid address.

Got this with Arduino IDE 2.2.1 and a Teensy4.0 project.

Solution was to close the IDE then delete everything in this folder: C:\Users\<YOUR USER NAME>\AppData\Local\Temp\arduino\sketches\