$ ionic upload
Uploading app....
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
Unexpected token < (CLI v1.5.0)
Your system information:
Cordova CLI: 5.0.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.5.0
Ionic App Lib Version: 0.1.0
ios-deploy version: 1.7.0
ios-sim version: 3.1.1
OS: Mac OS X Yosemite
Node Version: v0.12.2
Xcode version: Xcode 6.3.2 Build version 6D2105
I had similar issues but a different character: SyntaxError: Unexpected token /
I had some comments in my config.xml and my fetch.json file. Removed the comments and the upload worked.
getting the same error
Uploading app....
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:448:13)
Unexpected token < (CLI v1.5.0)
Your system information:
Cordova CLI: 5.0.0
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.9.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.5.0
Ionic App Lib Version: 0.1.0
OS: Distributor ID: Ubuntu Description: Ubuntu 15.04
Node Version: v0.10.38
ok did some digging the problem only happens if i set an --io-app-id or ionic link if left blank upload works fine
The response in Upload.getDirectUploadKey is generating a 404 only if the app_id is set
Is this good to close?
no still getting the same error
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/upload.js:186:25)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
Unexpected token < (CLI v1.5.5)
Your system information:
Cordova CLI: 5.1.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.0.0
Ionic CLI Version: 1.5.5
Ionic App Lib Version: 0.2.2
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.2 LTS
Node Version: v0.12.5
:+1:
I'm getting this issue too on windows and mac,
I'll try and verbose mac later when I'm home, mac was outputting similar to following :
Uploading app....
Upload failed.
Your system information:
<< to be updated >>
windows I have handy, heres my log :
Uploading app....
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.<anonymous> (C:\Users\Lewis\AppData\Roaming\npm\node_modu
les\ionic\node_modules\ionic-app-lib\lib\upload.js:186:25)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
Unexpected token < (CLI v1.5.5)
Your system information:
Cordova CLI: 5.1.1
Gulp version: CLI version 0.2.0
Gulp local: Local version 3.8.11
Ionic Version: 1.0.0
Ionic CLI Version: 1.5.5
Ionic App Lib Version: 0.2.2
OS: Windows 7 SP1
Node Version: v0.12.4
+1 on error
Uploading app....
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/upload.js:186:25)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
Unexpected token < (CLI v1.5.5)
Your system information:
Cordova CLI: 5.1.1
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.9.0
Ionic Version: 1.0.1
Ionic CLI Version: 1.5.5
Ionic App Lib Version: 0.2.2
ios-deploy version: Not installed
ios-sim version: 3.1.1
OS: Mac OS X Yosemite
Node Version: v0.12.0
Xcode version: Xcode 6.4 Build version 6E35b
Follow up: I re-run the ionic upload and worked successfully.
I've tested ionic upload since issue started and it seems to be the internet connection, Ionic refuses upload from dynamic ips, e.g starbucks, my work where we use complicated proxy server set ups. While it works fine on home connection / static IP server at work.
upload only works if you don't assign a --io-ap-id
Just had the same upload failed problem (upload.js). Running a Windows 8 machine.
I solved it by running npm update in my node_modules folder at
C:Users
It worked after that.
i have a error ,when i use ionic upload app,it shows ' An uncaught exception occurred and has been reported to Ionic Unexpected token / (CLI v1.6.5)'!i need ur help.plz give me some suggestion.thx~
+1
Uploading app....
An error occurred uploading the build: SyntaxError: Unexpected token <
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:478:9)
at process._tickCallback (node.js:392:17)
Unexpected token < (CLI v1.7.13)
Your system information:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local:
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.13
Ionic App Lib Version: 0.6.5
ios-deploy version: Not installed
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v5.4.0
Xcode version: Xcode 7.2 Build version 7C68
+1
Uploading app....
An error occurred uploading the build: SyntaxError: Unexpected token <
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at doNTCallback2 (node.js:441:9)
at process._tickCallback (node.js:355:17)
Unexpected token < (CLI v1.7.14)
Your system information:
Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.0
Gulp local:
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.4.0
ios-sim version: 3.1.1
OS: Mac OS X El Capitan
Node Version: v4.2.2
Xcode version: Xcode 7.2 Build version 7C68
$ ionic upload
Uploading app....
An error occurred uploading the build: SyntaxError: Unexpected token <
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:455:9)
at process._tickCallback (node.js:369:17)
Unexpected token < (CLI v1.7.14)
Your system information:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local:
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.3
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v5.3.0
Xcode version: Xcode 7.2 Build version 7C68
guys I had the same problem, but then tried building it in ios and android via commands:
ionic build ios
ionic build android
Later ionic upload worked fine.
I think ionic had some backend troubles. I also had this issue. So I tried the web-login and got an application error. After a few minutes the login worked again. So the problems seems to be fixed.
i had the same issue. But when you re run "ionic upload" again it work fine. so weird.
+1
Uploading app....
An error occurred uploading the build: SyntaxError: Unexpected token <
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.
at emitNone (events.js:85:20)
at IncomingMessage.emit (events.js:179:7)
at endReadableNT (_stream_readable.js:906:12)
at nextTickCallbackWith2Args (node.js:475:9)
at process._tickCallback (node.js:389:17)
Unexpected token < (CLI v1.7.14)
Your system information:
Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.6.0
Xcode version: Xcode 7.2.1 Build version 7C1002
+1
Uploading app....
An error occurred uploading the build: SyntaxError: Unexpected token <
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at doNTCallback2 (node.js:441:9)
at process._tickCallback (node.js:355:17)
Unexpected token < (CLI v1.7.14)
Your system information:
Cordova CLI: 5.4.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: Not installed
ios-sim version: 5.0.3
OS: Mac OS X El Capitan
Node Version: v4.2.2
Xcode version: Xcode 7.2 Build version 7C68
In my case, this happened because I set my own app_id in ionic.project, thinking it should be a bundle identifier. This yielded a 404 from the ionic upload API instead of a JSON response, which the API shows as HTML, hence the SyntaxError: Unexpected token <.
Remove it (set it to "" in ionic.project) and try again, or see if you might have deleted the app from your dashboard.
Running ionic upload again works for me.
+1Uploading app....
An error occurred uploading the build: SyntaxError: Unexpected token <
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
Unexpected token < (CLI v1.7.14)
Your system information:
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Version: 1.2.4-nightly-1917
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.6
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v0.12.5
Xcode version: Xcode 7.2 Build version 7C68
$ ionic uploadworked after running $ionic build ios
Hello all! Is this still an issue with the latest version of the ionic cli? Thanks for using Ionic!
I have experienced the issue with the latest version when re-uploading a project which was already previously uploaded by another user.
Steps to replicate the error :
Best,
Jesse
On May 4, 2016, at 11:06 AM, Justin Willis [email protected] wrote:
Hello all! Is this still an issue with the latest version of the ionic cli? Thanks for using Ionic!
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
Solution
ionic platform remove android
now in your ionic.config.json file on line 3, remove the app id string
example if you have
{
"name": "appName",
"app_id": "com.appbuilingr.httplocalbuilderpagedashboard.blogjobs"
}
This becomes
{
"name": "appName",
"app_id": ""
}
Then run "ionic plarform add android"
then
"ionic upload"
Getting this:
Caught exception:
SyntaxError: Unexpected end of input
at Object.parse (native)
at /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/io-config.js:169:24
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
For some reason /.io-config.json got replaced by an empty string did a git diff and recovered the contents of the file which contains app_id and api_key
{"app_id":"myid","api_key":"mikey"}
Thanks for opening the issue. It seems that issue has been resolved. I am going to close this issue but please feel free to reopen another issue if this occurs again.
Most helpful comment
In my case, this happened because I set my own
app_idinionic.project, thinking it should be a bundle identifier. This yielded a 404 from the ionic upload API instead of a JSON response, which the API shows as HTML, hence theSyntaxError: Unexpected token <.Remove it (set it to
""inionic.project) and try again, or see if you might have deleted the app from your dashboard.