Ionic serve takes long to create files

When running ionic serve in any project (ionic v4), the server that runs starts up and finishes compiling with no errors, but initially I get a blank page in the browser, with the following error in the console:
Failed to load resource: net::ERR_ADDRESS_IN_USE

I have the same result in my own projects, in blank starter and conference app.

If I check the network tab and refresh some combination of the following files fail to load:
polyfill.js
styles.js
main.js
vendor.js

If I keep refreshing the page, the files that fail to load change, but always a subset of the above 4. Files that previously loaded now fail to load and vice versa. Eventually (sometimes minutes later) the page will load.

$ ionic info
√ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)          : 4.1.1
   Ionic Framework            : @ionic/angular 4.0.0-beta.5
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.7
   @ionic/schematics-angular  : 1.0.5

System:

   NodeJS : v8.9.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.1.0
   OS     : Windows 8.1

typescript: 2.9.2
angular: 6.1.1

I have tried different browsers (chrome and firefox), disabling all plugins in chrome and disabling antivirus.

I suspect something has gone wonky on my computer, but not sure what it could be. Any suggestions are welcome.

1 Like

Didn’t noticed that before. When you restart your computer, before running ionic serve, ist the port 8100 already in use by a process or something?

Is someone aware of another port would should be free?

No, port 8100 is not in use, until I run ionic serve.

Well I’ll be damned I’m really slowly out of idea. Does someone use Windows too and faced the problem too? I mean I use a Mac I could confirm I don’t face that problem at all

J’utilise windows et jamais eu de soucis comme ça.
J’ai juste de temps en temps, sur ionic lab, un ecran noir mais je coupe et remets ionic serve et ça reviens normal.
Est ce que ça viens juste apres la création d’un nouveau projet?

Yes. If I create a new project from the blank template, I have this problem.

I’m pretty sure it’s specific to my computer, but not sure what.

Je vais essayé de créer un nouveau projet sous ionic 4.1.1 plus tard pour voir mais je pense qu’il y a un ptobleme de config sur le pc lui meme.
A voir s’il y a de la memoire dispo.
Peut est un bon néttoyage du pc sera a faire

Do you have more info about why it’s failing? 40x?

Also just read on Stackoverflow that a someone had the same error because of the firewall (https://stackoverflow.com/a/50178556/5404186), could you try to deactivate it?

+1 avec @reedrichards. J’ai aussi pensé au par-feu.
Chez moi j’avais ajouter chrome dans les éxéptions.
Voir aussi coté antivirus qui peuvent bloquer

Thanks for the suggestions.

Adding chrome to the firewall’s allowed apps doesn’t seem to have any effect.

Switching the firewall off through the control panel made matters worse - same errors, but after a few refreshes, the browser stopped TRYING to get any of the usual resources.

Stopping the firewall service had no effect.

@reedrichards The difference with that post is that I am just doing a local serve, not running on an Android device.

Je pense un probleme de fonctionnement du pc.
Deja commencer pas un bon nettoyage et une defragmentation

Maybe you should give a try to various CLI options https://ionicframework.com/docs/cli/serve/

like without devapp

ionic serve --no-devapp

or specify another port

ionic serve --port 84566

or disable external network usage

 ionic serve --local

etc.

Nothing seems to be working here. I think I am going to have to wipe my PC and start fresh :confused:

Sounds crazy. could you publish on GitHub the project you are testing? So I could check it out and double check that there isn’t something weird inside. I know you are using a fresh start project, but shit happens you know

Sure, here it is: https://github.com/moldstadt/ionic-blank

yep could confirm it just works fine

OH something pop up in my mind, in wich directory did you install your project? what’s the name of the parent’s folder?

I remember at some point, maybe with Stencil, I had a problem with a test project and I lost a lot of time till I figured out that the root of the problem was that the parent folder name was test

I have tried various projects, in different parent folders, e.g. D:\source\ionic, so I don’t think that is an issue here.

my gosh, i have no clue really, I’m sorry. I’m pr:disappointed_relieved:etty sure the reason is obvious and simple, we are searching to complicated maybe, but I can’t figure out what :disappointed_relieved:

je viens de tester sur mon vieux pc (6 ans)
telechargé node LTS 8.11.4 , dernier proposé sur node.js

ionic info

√ Gathering environment info - done!

Ionic:

ionic (Ionic CLI) : 4.1.1 (C:\Users\ludov_000\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : not installed
Cordova Platforms : not available
Cordova Plugins : not available

System:

NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 10

il a fallu environ 30 min pour que l’install ce fasse et je parle meme pas de l’ouverture du ionic serve qui a aussi mit plus de 15 min mais pas de message d’erreur.
je vois donc bien la différence entre mes 2 machines,
tu as vérifié si tu as pas un programme très gourmand qui tourne en fond sur ton pc???

1 Like