My AWS Amplify + React app throws an
Uncaught TypeError when running the production build, but works just fine with
Uncaught TypeError: Cannot read property 'call' of undefined
Uncaught TypeError: e[t] is undefined
After TOO much troubleshooting, I finally found the error. For some reason calling the main configure function would blow up in production but not dev - I assume some component got trimmed out by webpack. I am only using the the
Auth module of the Amplify SDK, so this solution works for me.
// This throws error in production
Somehow I managed to bump into this error twice a few months apart, and could not recall what I did to solve it the first time. Hopefully this saves you (and me) some troubleshooting time in the future.