Can't run syncmaps - Unauthorized

I’m trying to sync my sourcemaps with ionic monitoring syncmaps <appid> in a VS Code command window, but I get the following Unauthorized errors:

> git rev-parse HEAD
√ Running command - done!

? Do build before syncing? No
Syncing SourceMaps for app version 0.0.6 of com.xxxxxx (snapshot: xxxxx)- App ID xxxxxx
Syncing xxxxxxx\.sourcemaps\0.js.map
Syncing xxxxxxx\.sourcemaps\1.js.map
Syncing xxxxxxx\.sourcemaps\main.js.map
[ERROR] Unable to sync map xxxxxxx\.sourcemaps\0.js.map: Unauthorized
[ERROR] Try logging out and back in again.
[ERROR] Unable to sync map xxxxxxx\.sourcemaps\main.js.map: Unauthorized
[ERROR] Try logging out and back in again.
[ERROR] Unable to sync map xxxxxxx\.sourcemaps\1.js.map: Unauthorized
[ERROR] Try logging out and back in again.

What does this authorisation error mean? What am I “logging out and back in again” of from the command line?

Everything else works, I can push to git etc with no problems.

Of course I solved it within minutes of posting this. You need to set environment variables IONIC_EMAIL and IONIC_PASSWORD.

Use the Ionic CLI login command:

$ ionic login [<email>] [<password>]

https://ionicframework.com/docs/cli/login/

1 Like