-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 not found error for glyphicons-halflings-regular.ttf/woff/woff2 #1169
Comments
Had the same problem today, I fixed it by adding the // Only applies for fonts from bower dependencies
// Custom fonts are handled by the "other" task
gulp.task('fonts', function () {
return gulp.src($.mainBowerFiles())
.pipe($.filter('**/*.{eot,otf,svg,ttf,woff,woff2}'))
.pipe($.flatten())
.pipe(gulp.dest(path.join(conf.paths.tmp, '/serve/fonts/')))
.pipe(gulp.dest(path.join(conf.paths.dist, '/fonts/')));
}); Also need to properly override the bootstrap icon font location in the $icon-font-path: '../fonts/' !default; Technically you can then also remove the "replace font paths" line from return gulp.src(path.join(conf.paths.tmp, '/serve/*.html'))
.pipe($.inject(partialsInjectFile, partialsInjectOptions))
.pipe($.useref())
.pipe(jsFilter)
.pipe($.sourcemaps.init())
.pipe($.ngAnnotate())
.pipe($.uglify({preserveComments: $.uglifySaveLicense})).on('error', conf.errorHandler('Uglify'))
.pipe($.rev())
.pipe($.sourcemaps.write('maps'))
.pipe(jsFilter.restore)
.pipe(cssFilter)
// .pipe($.replace('../../bower_components/bootstrap-sass/assets/fonts/bootstrap/', '../fonts/'))
.pipe($.cssnano())
.pipe($.rev())
.pipe(cssFilter.restore)
.pipe($.revReplace())
.pipe(htmlFilter)
... Then just do a gulp serve and it should come good. |
well, it doesn't work to mine, if part of the path or file content should be different on my computer? |
Not sure to be honest, I used the generator to create a project with angluar 1.5.x, normal JavaScript (no ES6) and SASS stylesheet processor. The 2 files I referenced above are generated by yo and placed at the relative path of the project folder. So if your workspace is at |
Hi I had the same problem and changing path in .tmp/serve/index.html is not the solution because it's just a compilation of source/index.html. The Best SOLUTION that I found is to change path in build.js like this: .pipe($.replace('../../../bower_components/bootstrap-sass/assets/fonts/bootstrap/', '../fonts/')) and in index.scss liek this: $icon-font-path: "../../bower_components/bootstrap-sass/assets/fonts/bootstrap/"; |
@AbdelhadiLahlou this only works for |
@bertramn your solution works for
|
@bertramn this works for me after change |
so what is the solution now for this |
This solution will work. In index.scss add $icon-font-path: "../bower_components/bootstrap-sass/assets/fonts/bootstrap/"; In gulp/build.js add .pipe($.replace('../bower_components/bootstrap-sass/assets/fonts/bootstrap/', '../fonts/')) |
I vote for sunilkumarkm's solution. In index.scss, changed from In gulp/build.js, changed from |
Hi,all
I just followed the course in Lynda "MEAN Stack and MongoDB Development Techniques", when I have installed "gulp" successfully, and run "gulp serve", the browser throws a "404 not found error" for these resources:
the version of my gulp is
the version of my computer is OS 10.11.6
I have read the other solutions and tried but all failed.
The text was updated successfully, but these errors were encountered: