Ionic Serve- www/ files missing (404 error)

Jordan Benge
2 min readDec 6, 2018

--

The error to rule them all…

Found yourself in a pickle, haven’t you? You probably found this article by Googling something similar to the article title, which led you to a rabbit hole of negative StackOverflow questions, Github Issue trackers, Ionic Form posts and the occasional Google Groups Question.

The Rabbit hole

Just me? That’s fine. Every search led me to a dead-end list of suggestions:

Just run ionic-doctor check ionic-doctor check, remove your node_modules , Closing this issue due to broadness/lacking info/some-other-non-helpful-closing-reason

You’ve probably done everything that I did. Wanting to rip out your hair, reverting commits, changing branches, and not understanding what happened to cause the (seemingly random) issue…

Turns out (for me at least) this error was caused by using an ambiguous array type. So how did I come to this conclusion? I went through my app commit for the day, when the error started popping up (which only happens on a new ionic serve session, it doesn’t occur when using live-reload.

How to fix it?

It’s so simple, and it bothers me so much. Terminal didn’t output any useful error, according to it, everything was running peachy-keen.

Simply change your array definitions from:

arr: [] = [...]

to

arr: any[] = []

It’s really that simple. Make those changes, close ionic-serve and relaunch it. If it was the same issue that I was having, your build will work this time. If not, it’s back to the rabbit hole for you.

Questions?

You can find me on:
- GitHub: https://github.com/bengejd/
- Medium: https://medium.com/@JordanBenge

Who am I? My name is Jordan Benge, I am a Software Developer who loves helping others and contributing to Open-Source. I’ve been working in the Ionic Framework since Ionic 1, and have tried to keep up to date on the latest and greatest when it comes to Hybrid Mobile App Development.

If you enjoyed this story, please click the 👏 button and share to help others find it! Feel free to leave a comment below if you need any help.

--

--

Jordan Benge

My name is Jordan Benge, I’m a freelance developer, who sometimes likes to write helpful articles on Medium for people who want to do things but don’t know how.