Hey there @carlosrojas1, welcome to the Auth0 Community!
After investigating this challenge I found that you had already opened a support case and solved this issue with a work around. I’m going to share the work around here for benefit others as well.
In the end it was related to some Babel/Webpack optimizations that are conducted during the production build of GatsbyJS V2. This optimizations left the auth.js library in a weird state. Carlos found the work around was to disable the webpack optimization and reduce the babel backward compatibility level so the AuthJS library doesn’t break. The compatibility levels used for babel were the GatsbyJS default ones.
Please let us know if you have any additional questions we can assist with!