Error while compiling snapshot

Sometimes when I compile image (any version of OpenWrt) I get this fatel error. I have to nuke everything & recompile whole source code from scratch just to fix it. Does anyone know why it's happening with easier solution?
Windows 10 Pro using Ubuntu app

make[6]: Entering directory '/home/alan/openwrt/pi/openwrt/build_dir/hostpkg/libubox-2021-05-16-b14c4688'
[ 47%] Building C object CMakeFiles/blobmsg_json.dir/blobmsg_json.c.o
In file included from /usr/include/json/autolink.h:9,
                 from /usr/include/json/json.h:9,
                 from /home/alan/openwrt/pi/openwrt/build_dir/hostpkg/libubox-2021-05-16-b14c4688/blobmsg_json.c:23:
/usr/include/json/config.h:9:10: fatal error: string: No such file or directory
    9 | #include <string> //typdef String
      |          ^~~~~~~~
compilation terminated.
make[6]: *** [CMakeFiles/blobmsg_json.dir/build.make:82: CMakeFiles/blobmsg_json.dir/blobmsg_json.c.o] Error 1
make[6]: Leaving directory '/home/alan/openwrt/pi/openwrt/build_dir/hostpkg/libubox-2021-05-16-b14c4688'
make[5]: *** [CMakeFiles/Makefile2:228: CMakeFiles/blobmsg_json.dir/all] Error 2
make[5]: Leaving directory '/home/alan/openwrt/pi/openwrt/build_dir/hostpkg/libubox-2021-05-16-b14c4688'
make[4]: *** [Makefile:149: all] Error 2
make[4]: Leaving directory '/home/alan/openwrt/pi/openwrt/build_dir/hostpkg/libubox-2021-05-16-b14c4688'
make[3]: *** [Makefile:114: /home/alan/openwrt/pi/openwrt/build_dir/hostpkg/libubox-2021-05-16-b14c4688/.built] Error 2
make[3]: Leaving directory '/home/alan/openwrt/pi/openwrt/package/libs/libubox'
time: package/libs/libubox/host-compile#0.15#1.01#1.10
    ERROR: package/libs/libubox [host] failed to build.
make[2]: *** [package/Makefile:112: package/libs/libubox/host/compile] Error 1
make[2]: Leaving directory '/home/alan/openwrt/pi/openwrt'
make[1]: *** [package/Makefile:108: /home/alan/openwrt/pi/openwrt/staging_dir/target-aarch64_cortex-a72_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/alan/openwrt/pi/openwrt'
make: *** [/home/alan/openwrt/pi/openwrt/include/toplevel.mk:230: world] Error 2