glad you got it to work - is it possible that the code wasn’t commented out all the way? the netlify build process isn’t really different than a local one per se, so i wonder whether this was maybe also not working on a local build?
secondarily, this comes to mind - maybe warnings were being treated as errors?