Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

dist: 404 on glyphicons-halflings-regular.woff #665

Closed
olalonde opened this issue Apr 26, 2014 · 13 comments
Closed

dist: 404 on glyphicons-halflings-regular.woff #665

olalonde opened this issue Apr 26, 2014 · 13 comments

Comments

@olalonde
Copy link

I'm using this generator but updated bootstrap to "bootstrap": "~3.1.1". The problem is when I grunt build it seems the CSS file tries to find glyphicons-halflings-regular.woff in bower_components/ instead of fonts/. How can I fix this?

Here's the full HTTP error:

Failed to load resource: the server responded with a status of 404 (File not found) http://localhost:8000/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
Failed to load resource: the server responded with a status of 404 (File not found) http://localhost:8000/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
Failed to load resource: the server responded with a status of 404 (File not found) http://localhost:8000/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular
@olalonde
Copy link
Author

For some reason, my minified CSS file imports the font using the absolute URL instead of the relative URL that is in the non minified file:

src:url(/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot)

@leikind
Copy link

leikind commented Apr 29, 2014

I have got the same problem

@boltex
Copy link

boltex commented Apr 30, 2014

I have got the same problem, a fresh install of the angular generator prepared with the 'grunt' command gives 404 errors for the fonts if the 'dist' folder is served by a webserver!!!

@sysofwan
Copy link

sysofwan commented May 1, 2014

I have the same problem. It did not happen in previous version. Only in version 0.8.0

@olalonde
Copy link
Author

olalonde commented May 1, 2014

This is pretty annoying... I have to manually edit the minified CSS file after each build. Guess I could write a task that does this for me but I'm sure there has to be a "cleaner" way to fix this.

@olsn
Copy link

olsn commented May 2, 2014

I had the same issue, I fixed this by modifying the usemin in my Gruntfile and added a pattern:
(It's a rather ugly fix I guess, but works for me, credit goes to this post: yeoman/yeoman#824 (comment))

usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      options: {
        assetsDirs: ['<%= yeoman.dist %>'],
        patterns: {
          css: [
            [/(\/bower_components\/bootstrap\/dist\/fonts)/g, 'god help me', function(match) {
              return match.replace('/bower_components/bootstrap/dist/fonts', '../fonts');
            }]
          ]
        }
      }
    },

@olalonde
Copy link
Author

olalonde commented May 4, 2014

@olsn thanks, I will use that fix for now although it's not very elegant :)

@eddiemonge
Copy link
Member

Please help to verify the fixes resolve the issues you have been having. You will need to test using the latest git code. Here are the instructions on how to do that:

  • cd to a testing directory, preferable an empty one

    git clone git@github.com:yeoman/generator-angular.git
    cd generator-angular
    npm link
    cd ..
    mkdir testfonts && cd $_
    yo angular
  • Test the generator with different prompts.

Let me know if you have any issues by replying here or opening a new issue.

@leikind
Copy link

leikind commented May 23, 2014

Hey, I followed your steps, ran grunt build, and the problem is still there

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/styles/vendor.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/bower_components/bootstrap-sass-official/vendor/asset…nts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular

@leikind
Copy link

leikind commented May 23, 2014

Hm, actually none of the font files are in the dist directory, neither in the app generated following your instructions nor in my app

$ find dist -name 'glyphicons-halflings-regular.*'

@eddiemonge
Copy link
Member

@leikind please open a new issue please with your exact steps.

jcamelis pushed a commit to jcamelis/generator-angular that referenced this issue Jul 15, 2014
Fix handling of Bootstrap fonts. This correctly loads the fonts in
`grunt serve` as well as `grunt serve:dist`. This should hopefully close
all the PR's and issues related to Bootstrap fonts.

Also removes styles being duplicated in a the output CSS file.

This includes a potentially breaking change in that `root` of **cssmin**
has been reverted (removed).

Closes yeoman#552
Fixes yeoman#638
Fixes yeoman#645
Closes yeoman#661
Fixes yeoman#662
Partially closes yeoman#664
Fixes yeoman#665
Fixes yeoman#667
@coderDem
Copy link

@olsn You saved me thx. I use the generator-angular version 0.8.

@eddiemonge
Copy link
Member

@coderDem the latest is fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants