Handle errors when building to js.