App.bundle.js disappears; in previous commits on Git

While working on my ionic 2 app, seemingly in a random way the app.bundle.js and map file along with that in the www/build/js folder disappeared, giving me a 404 error that it could not find the file. I tried updating the cli via node js commands and that did not fix the problem. I tried reverting back to previous commits, copying over the app.bundle.js files, and testing but since they are at different states in the app it didn’t load my current changes.

Without creating a new project how can I fix this?

I suspect during a build, webpack encountered an error and did not build app.build.js. You might have accidently made a commit after that point, hence your issue. That file is generated during the build process, so it should be able to be regenerated.

So how do I regenerate that file? Otherwise my app will not run. Is there a command or a procedure I can go through to regenerate the file and its map file?

Have you tried ionic serve?

Yes, I do all of my testing using ionic serve. It gives me 404 error saying the app.bundle.js file cannot be found, which it can’t because it really is not in that directory. What other ideas do you have?

There are no errors reported in the console while building?

Haha I found it! I never would have looked in the server console for that!! I always do most of my error checking in the browser console. Thank you so much!!