CSS Missing from build 404


#1

When i run ionic serve my app loads but all my styles are missing.

I get a 404 response in the dom console which reads:

Failed to load resource: the server responded with a status of 404 (Not Found)

Indicating that /build/css/app.ios.css is missing.

I then check my app and there is no css files or a css folder.

The only thing i can think of that might have done this is running ‘ionic build’ would that affect anything?


#2

Note to help others

I ran gulp build from root of project through terminal, that then generated the css directory and files again.

I think went through and fixed a few javascript errors.


#3

Hmm, sounds like this could be an outdated CLI not running the commands.
Make sure you have the latest beta CLI installed

npm i -g ionic@beta

#4

I’m experiencing the same issue. I run

again just to make sure I have the latest version.

gives me 2.0.0-beta.25. Is it correct version?

In any case, css is still missing from build directory.

Any advise?


#5

This is new project? If not, may be you need create new and copy your files.


#6

Well, I use git with remote repository. So, it works well on one computer (with local repository), but when I clone the repository on other computer, I get this problem.

My .gitignore is as following:

node_modules/
www/build/
platforms/
plugins/
.DS_Store

After cloning the repository I had to run “npm install” to install node_modules.

I also noticed there is this error when I run “ionic serve”:

Error: Import directives may not be used within control directives or mixins.
on line 34 of node_modules/ionic-angular/components.core.scss
@import “fonts/ionicons”;
–^


#7

ah, you have old Ionic version. It fixed on beta.6 (latest)
or you can remove if from node_modules/ionic-angular/components.core.scss file


#8

Thanks @xr0master!

Another question though:

After I run

the installed version of ionic I get is 2.0.0-beta.25. What should I do to install beta 6?


#9

It is Ionic CLI
you need update ionic-angular package. However Ionic Team have been changed some things, so it’s not easy )


#10

Yeh, this is what I was thinking. It solved the problem.
Thanks @xr0master!