Fix issue on build with JS error occurring