Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic serve loading wrong app

I have created my first Ionic app using CLI, so I did:

ionic start my-project --v2 blank

I run ionic serve command inside the project's folder, and I can see the brand new project in the browser. I did some changes in the project and run ionic serve again, perfectly fine.

I created another project with CLI:

ionic start second-project --v2 blank

Then, I run ionic serve from inside the second project's folder and the first one is actually loaded, not the second one.

What did I miss?

like image 749
skinny_jones Avatar asked Feb 21 '17 16:02

skinny_jones


2 Answers

I didn't try to clear the browser history but I remembered that I did play around with Service Workers in my first app, it was a PWA.

So I ran ionic serve then opened Chrome's Developer Tools and found out that it was still there, so I Unregistered the service worker and deleted it under the Cache Storage section.

Stopped and ran ionic serve again and it loads the right app now.

like image 95
skinny_jones Avatar answered Nov 03 '22 17:11

skinny_jones


This is how I solved this issue.

Chrome was still using the cache from that previous app. I ran ionic serve it loaded my wrong app, then I opened the Developer Tools, and under Applications tab, Service Workers option, it was there.

I clicked the 'Unregister' option, then under 'Cache Storage' section I deleted the registered previous application's cache with the right click option. This solved my problem.

like image 4
Kamran Kazmi Avatar answered Nov 03 '22 19:11

Kamran Kazmi