shade_171
shade_171

Reputation: 23

Ionic serve try again later [Failed to load index.html]

I've installed ionic and cordova but when I created an application and tried to run it i get this in terminal-

ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] [19:17:47]  ionic-app-scripts 3.1.11 
[app-scripts] [19:17:47]  watch started ... 
[app-scripts] [19:17:47]  build dev started ... 
[app-scripts] [19:17:47]  clean started ... 
[app-scripts] [19:17:47]  clean finished in 3 ms 
[app-scripts] [19:17:47]  copy started ... 
[app-scripts] [19:17:47]  deeplinks started ... 
[app-scripts] [19:17:47]  copy finished in 13 ms 
[app-scripts] [19:17:47]  deeplinks finished in 14 ms 
[app-scripts] [19:17:47]  transpile started ... 
[app-scripts] [19:17:52]  transpile finished in 5.34 s 
[app-scripts] [19:17:52]  preprocess started ... 
[app-scripts] [19:17:52]  preprocess finished in less than 1 ms 
[app-scripts] [19:17:52]  webpack started ... 
[app-scripts] [19:17:58]  webpack finished in 6.42 s 
[app-scripts] [19:17:58]  sass started ... 
[app-scripts] Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[app-scripts] [19:18:00]  sass finished in 1.36 s 
[app-scripts] [19:18:00]  postprocess started ... 

[INFO] Development server running!

       Local: http://localhost:8100
       External: http://192.168.0.9:8100
       DevApp: TestApp@8100 on heath

       Use Ctrl+C to quit this process

[INFO] Browser window opened to http://localhost:8100!

[app-scripts] [19:18:00]  watch ready in 13.45 s 
[app-scripts] [19:18:01]  Failed to load index.html 

and in browser i'm getting 'try again later'. How do i resolve this?

Upvotes: 2

Views: 5829

Answers (3)

user542319
user542319

Reputation: 403

npm update worked for me - windows 10

Upvotes: 0

Charis The Programmer
Charis The Programmer

Reputation: 959

I had the same error on my system with the following specs:

$ ionic info
✔ Gathering environment info - done!
[WARN] You are not in an Ionic project directory. Project context may be missing.

Ionic:

   ionic (Ionic CLI) : 4.1.2

System:

   NodeJS : v8.11.4
   npm    : 5.6.0
   OS     : macOS High Sierra

I resolved it by running the following command in the project folder:

npm install

Upvotes: 6

srirammaswamy
srirammaswamy

Reputation: 11

Sometimes it may happen due to insufficient write permissions to the source files like index.html

To solve this in linux you can follow any one of the following 2 ways.

1: Run ionic serve command using superuser permissions. i.e. use sudo ionic serve instead of ionic serve

2: Change the permissions of the project folder (add write permission to all users). This can be done by using chmod command -> sudo chmod a+w name_of_project_folder

Upvotes: 1

Related Questions