Mapbox worked just fine inside the development environment but when I deployed to production, gboooooa! An error pop up in the console slapping my face and the map did not display.
Uncaught ReferenceError: y is not defined
Initially, I thought this was a Netlify thing (I deployed to Netlify by the way) until I discovered it wasn't. The error was from the current version of Mapbox - version 2.0.x
There is no permanent fix for this yet. It's still been worked upon. However there is a work around.
mapbox-gl. Yes, that's the work around. You have to downgrade
mapbox-gl to version @1.13.0 for it to work. The error is with version 2.0.x
First uninstall version 2.0.x in your project
run `npm uninstall mapbox-gl"
npm install firstname.lastname@example.org
Yeah. You're good to go now.