Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Running bower install on new ionic project breaks reload #4

Closed
k4roshi opened this issue Sep 21, 2015 · 9 comments
Closed

Running bower install on new ionic project breaks reload #4

k4roshi opened this issue Sep 21, 2015 · 9 comments
Labels

Comments

@k4roshi
Copy link

k4roshi commented Sep 21, 2015

After following the quickstart procedure running bower update on the project root breaks cordova-hcp.
Changing the index.html in www doesn't cause the app to reload. Not even running ionic run updates the app correctly.
For me it was triggered by installing ionicons with the command ionic add ionicons.
That caused angular 1.4.3 to install, hope it's useful.

@nikDemyankov
Copy link
Member

Interesting. Will look into that, thanks.

@k4roshi
Copy link
Author

k4roshi commented Sep 23, 2015

Apparently using ionic 1.0 and angular 1.3.13 solves this.
I ran the app using XCode and got those errors with ionic 1.1 and angular 1.4.3:
2015-09-23 14:56:52.408 test[51572:679711] Loaded file lib/angular/index.js
2015-09-23 14:56:52.897 test[51572:679711] Loaded file lib/angular-animate/index.js
2015-09-23 14:56:53.361 test[51572:679711] Loaded file lib/angular-sanitize/index.js
2015-09-23 14:56:53.909 test[51572:679711] Loaded file index.html
2015-09-23 14:56:54.372 test[51572:679711] Error during update: Failed to load file

And it happens while loading lib/angular/.bower.json

@nikDemyankov
Copy link
Member

Those errors happen without plugin, or only when it is installed?

@k4roshi
Copy link
Author

k4roshi commented Sep 23, 2015

Only with the plugin, they're actually output from the plugin.

@nikDemyankov
Copy link
Member

Can you, please, provide step-by-step guide on how to reproduce it? From creating new project to acquiring that error. Like:

  1. Create new project:

    ionic start TestProject blank
  2. Add iOS platform:

    ionic platform add ios

and so on...

@k4roshi
Copy link
Author

k4roshi commented Sep 23, 2015

Sure:
first of all be sure to have the latest ionic cli installed and that the app references ionic 1.1

ionic start demonstration blank
cd demonstration
ionic platform add ios
ionic build
ionic plugin add cordova-hot-code-push-plugin

now, in two separate windows:

cordova-hcp server
ionic run

At this point editing index.html works perfectly fine and the app is correctly updated live.

After that, running

ionic add ionicons

(but really, adding any bower component or running bower update)
makes it break completely.

cordova-hcp server correctly reports:

Build 2015.09.23-15.56.45 created in /Users/k4roshi/Projects/demonstration/www
Should trigger reload for build: 2015.09.23-15.56.45

but the app doesn't update.

If I run the app using xcode, instead of ionic run, i get the errors i pasted earlier. The error that makes everything hang (Error during update: Failed to load file) happens when the plugin tries to download
lib/angular/.bower.json that doesn't really exist.

@nikDemyankov
Copy link
Member

Awesome, thanks for that!

@nikDemyankov
Copy link
Member

Well, it seems that this is a problem of the CLI client: it doesn't upload files with the . in the beginning of their names. Those files are usually considered as hidden. So CLI client is not loading them, although, it does put them in the manifest file.

That is why, when you do ionic add ionicons - it builds correctly, but deploy command is ignoring hidden files. Plugin receives notification, that something has changed. It loads new chcp.manifest and tries to download newly added files. But since it can't locate .bower.json - it stops the update procedure. And from that moment, no matter what you change - it's not gonna update, until .bower.json is found.

Will create an issue for CLI client.

@nikDemyankov
Copy link
Member

Created CLI client issue - nordnet/cordova-hot-code-push-cli#8 . This one is closed since it's not a plugin's issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants