I’ve seen this a few times with Magento + Square, and that console error is usually a symptom rather than the root cause.
A few things worth checking:
1) Application secret vs access token
Some Magento Square extensions label the field as ‘Production Application Secret’, but they don’t always mean the access token. A lot of them actually expect the OAuth application secret instead. If the wrong one is pasted in, Square can’t fully initialise and checkout JS starts failing, which can surface as errors like uid being undefined.
It’s worth double checking which credential your specific extension expects in that field.
2) Location ID not loading
Square’s Web Payments SDK needs a valid Location ID. If the Magento config screen is meant to auto-populate a location dropdown and it’s empty or stuck on ‘please select location’, that usually means authentication isn’t working correctly.
You can confirm the Location ID in the Square Developer Dashboard and make sure Magento is pointing at the correct production location.
3) First error in the console matters most
The uid error often shows up after something earlier fails. Have a look for any errors above it like:
- invalid configuration
- locationId missing or invalid
- square.js failing to load
Those usually point much more clearly to what’s actually wrong.
4) Cache, JS and theme checks
Magento can make this harder than it needs to be:
- Flush cache and redeploy static content after changing Square settings
- Temporarily disable JS bundling or minification to rule out load order issues
- If you’re using a custom checkout or theme, try testing briefly on Luma or default checkout to see if the issue disappears
Also worth mentioning that different Magento Square extensions expect credentials slightly differently. Knowing exactly which extension you’re using helps narrow this down very quickly.
Hope that helps you get pointed in the right direction.