Haxe Compiler 4.0.0 (git build development @ 085f38e)
I found this unsused line in my main.lua:
__lua_lib_lrexlib_Rex = _G.require("rex_pcre")
It breaks my script as I dont have that requirement around.
__lua_lib_lrexlib_Rex is apparently not used anywhere within my result lua script and removing that line fixed my problem. My actual workaround is to add an empty "rex_pcre.lua" file next to my script.
I dont know what that module does (please excuse my ignorance), but if it references libpcre-1.dll in my haxe installation folder, I can not have it! Factorio does not allow anything but plain lua imports.