Description:
A freshly generated app using tabs starter template fais to run.
It gives the error: "Failed to load index.html"
Steps to Reproduce:
npm i ionic -g
npm i cordova -g
ionic start app tabs
cd app
ionic serve
Output:
My ionic info:
cli packages: (C:\Users\SarathKCM\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
local packages:
@ionic/app-scripts : 3.1.8
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.3
npm : 5.8.0
OS : Windows 10
Misc:
backend : pro
Other Information:
Output from console:
ionic serve
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser -
Ctrl+C to cancel
[16:06:42] watch started ...
[16:06:42] build dev started ...
[16:06:42] clean started ...
[16:06:42] clean finished in 3 ms
[16:06:42] copy started ...
[16:06:42] deeplinks started ...
[16:06:42] copy finished in 10 ms
[16:06:42] deeplinks finished in 10 ms
[16:06:42] transpile started ...
[16:06:46] transpile finished in 3.90 s
[16:06:46] preprocess started ...
[16:06:46] preprocess finished in less than 1 ms
[16:06:46] webpack started ...
[16:06:53] webpack finished in 6.79 s
[16:06:53] sass started ...
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.
[16:06:54] sass finished in 1.01 s
[16:06:54] postprocess started ...
[16:06:54] dev server running: http://localhost:8100/
[OK] Development server running!
Local: http://localhost:8100
External: http://192.168.43.190:8100
DevApp: app@8100 on SARATHKCM
[16:06:55] Failed to load index.html
[16:06:55] watch ready in 12.65 s
Same issue with the blank app as well.
Odd.. I'm not seeing this. What does the app look like in the browser? Is it broken?
it says "try again later"

To check if it is any environment-related issue, I tried the same steps using WSL-Ubuntu, and got the same error- and the browser says "try again later".
ionic info
cli packages: (/home/sarathkcm/.nvm/versions/node/v8.11.1/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
local packages:
@ionic/app-scripts : 3.1.8
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.11.1
npm : 5.6.0
OS : Linux 4.4
Misc:
backend : pro
Wow, that's weird. Can you verify that www/index.html file exists? If it does, can you tell me if the IONIC_HTML_TO_SERVE environment variable is set?
Wow, that's weird. Can you verify that www/index.html file exists?
It does not exist. Shouldn't this be generated by ionic serve command?
If it does, can you tell me if the IONIC_HTML_TO_SERVE environment variable is set?
Please let me know if you still need this, I am unaware of how to get this value. node -p "process.env.IONIC_HTML_TO_SERVE" gives undefined.
It does not exist. Shouldn't this be generated by ionic serve command?
Only if src/index.html exists. Does it?
src/index.html exists..
Here's the generated app folder minus the node_modules and .git folders, if it helps.
Hey @sarathkcm were you able to solve it? I have the exactly same issue.
@GQBrendel Sadly no. Spend a lot of time trying to resolve it, got demotivated and didn't pursue that project further.
@sarathkcm Sorry, I must've missed the notification for this issue. I downloaded your zip file but it runs for me.

The error you're getting is coming from these lines of code: https://github.com/ionic-team/ionic-app-scripts/blob/master/src/dev-server/http-server.ts#L81-L85 (in the @ionic/app-scripts package). I noticed the err is being ignored, but you could add this line of code to print it: console.error(err); (the file would be ./node_modules/@ionic/app-scripts/dist/dev-server/http-server.js)
Our tooling for Ionic v3 projects is falling behind because we've been focused so much on v4, which uses Angular 6 and the Angular CLI. If you're curious what's going on with that, please see https://github.com/ionic-team/ionic-cli/issues/3019
@dwieeb Thank you for responding. Most strange thing happend when I tried your instructions to check the error. 'Ionic serve' woked without any issues for the same project folder and setup I had left in my hobbies folder 2 months ago!!!. It must have been some system settings or some other processes that caused the issue at the time.
@GQBrendel can probably try and see what error is shown.
I'm getting same error
I get the same error with this repo:
https://bitbucket.org/apollorocks/pure-javascript/src/master/
Is this a version issue?
In my case, I fixed it with sudo command
"npm update" had the same error there and updating the packages worked for me.
"npm update" had the same error there and updating the packages worked for me.
This fixes for me.
"npm update" had the same error there and updating the packages worked for me.
I used sudo and fixed for me :)
npm update worked for me
+1
I have the same problem in a project I downloaded (the ionic-stencil-essential theme).
Any update on a fix?
npm update this fix for me
Sounds like npm update is the fix. Perhaps the node_modules needs a refresh.
npm update worked
great, thanks @dwieeb This worked for me as well.
working after deleting node_modules and than run npm install
not woking for me after update npm update as well as deleting the node_modue then install npn install,there is any other way to fix above problem?
I solved this by changing my package.json and package-lock.json "name" key which featured a space. It worked after I removed the space (it was like "My Project" so I changed it to "myproject").
Seems like this space was crashing the npm install command, so ionic serve wouldn't work as expected.
Most helpful comment
"npm update" had the same error there and updating the packages worked for me.