generator-cg-angular icon indicating copy to clipboard operation
generator-cg-angular copied to clipboard

DEV: 404 error on glyphicons-halflings-regular.woff

Open Jakobovski opened this issue 10 years ago • 17 comments

After grunt build the CSS file tries to find glyphicons-halflings-regular.woff in fonts/ instead of in bower_components/. I am therefore getting a 404 error GET http://localhost:9001/fonts/glyphicons-halflings-regular.woff 404 (Not Found)

See similar issue: See https://github.com/yeoman/generator-angular/issues/665

Jakobovski avatar Jun 05 '14 20:06 Jakobovski

The generator uses Font Awesome by default. Did you undo that?

You'll need to make sure the glyphicons font is copied over. You'll likely also need to change the bootstrap LESS var for the icon path. By default I think that path is ../fonts which is causing your problem. You just need to make sure the relative location of the fonts to the css file is the same as the relative pathing is in development.

cgross avatar Jun 05 '14 21:06 cgross

I did not change the default font from Font Awesome. They only thing that is not default in my build is the use of ui-router.

Your suggested fix solved my issue, thanks! It would still be nice to get this to work out of the box.

Jakobovski avatar Jun 05 '14 21:06 Jakobovski

Out of the box it uses Font Awesome. Font Awesome is a replacement for glyphicons in bootstrap. If you've using glyphicons instead of Font Awesome icons you'll get an error like this (but you'll see it regardless of the dist build or just running from the development files).

cgross avatar Jun 05 '14 23:06 cgross

Alright... Can I add that bootstrap glyphicons are not supported to the README?

Jakobovski avatar Jun 06 '14 14:06 Jakobovski

So what is the recommended fix for this. Not to use font-icons with angular bootstrap or not to use glyphicons ?

mkhanal avatar Jun 17 '14 01:06 mkhanal

Anyone have a fix for this? After build, our project is still looking for the bootstrap-sass glyphicons to root/bower_components instead of the dist folder.

ashukur avatar Jun 19 '14 22:06 ashukur

bootstrap-sass? Thats not part of this generator (yet). If you have some stylesheet thats referencing a font, you need to ensure that the font file is copied to /dist during the build and that the relative location of that font to the css file is the same as it was in the original dev environment.

cgross avatar Jun 20 '14 00:06 cgross

You should be using bootstrap-sass-official, which is the official sass port of Bootstrap.

eranimo avatar Jul 06 '14 02:07 eranimo

I've had to add this my Gruntfile.js to get rid of this error:

grunt.initConfig > copy > main > files >

{src: ['bower_components/bootstrap/fonts/**'], dest: 'dist/',filter:'isFile',expand:true}

Should not have to do this out of the box.

bolora avatar Aug 04 '14 17:08 bolora

I just realized that we always use our custom TWBS so we change the icons back to glyphicons. So technically, out of the box this error does not occur.

So you can reject this PR but I agree with Jakobovski, there should be something added to the README that states that is you use native TWBS then you have to make the addition to the Gruntfile.

Personally, although I think FontAwesome is indeed awesome, hacking Twitter Bootstrap out of the box is an unfortunate decision.

bolora avatar Aug 04 '14 18:08 bolora

Chris, can you close this issue since you merged my PR in 5b4a9c894 ?

bolora avatar Aug 08 '14 16:08 bolora

Is it mentioned anywhere in the README or anywhere else that the purpose of font awesome is to replace the glyphicons font?

When we initially generated our project, we saw the reference to font awesome, but we removed it because I didn't understand why it was there.

LegalizeAdulthood avatar Dec 08 '14 17:12 LegalizeAdulthood

I still get the 404 error if I implement some of the angular-bootstrap components (like a datepicker). I have {src: ['bower_components/bootstrap/fonts/**'], dest: 'dist/',filter:'isFile',expand:true} in my gruntfile. Can anyone confirm this is still happening if u implement such a component?

ghost avatar Apr 10 '15 08:04 ghost

@kennethvdberghe same problem while working with datepicker

DuLerWeil avatar Apr 20 '15 18:04 DuLerWeil

@kennethvdberghe yes, it still happening.

StanislavPrusac avatar May 14 '15 14:05 StanislavPrusac

If your web server is IIS try this method: Go in to the IIS console, click MIME Types icon and add .woff as application/octet-stream – problem solved!

ukalpa avatar May 27 '15 20:05 ukalpa

you need to register Mime types for .woff files. in IIS server see this http://projectseven.com/tutorials/servers/iis-woff/index.htm

Ali-Usmaan avatar Apr 14 '16 07:04 Ali-Usmaan