fonts - Ignore certain Gulp-less errors, or prevent it from attempting to call @imports with css keyword -


so using gulp task engine handle less compilation (among other things), , part of our stylesheets include fonts fonts.com.

here's relevant task in our gulpfile:

var gulp = require('gulp'),         plugins = require('gulp-load-plugins')({ camelize: true });         browsersync = require('browser-sync');         reload = browsersync.reload;  gulp.task('styles', function() {     gulp.src(['less/styles.less',                     'less/special-styles.less',                     'less/special-styles2.less',                     'less/special-styles3.less',                     'less/special-styles4.less',                     'less/special-styles5.less',                     'less/special-form-styles.less'])         .pipe(plugins.less())         .on('error', plugins.util.log)         .pipe(plugins.autoprefixer('last 15 versions', 'ie 8', 'ios 6', 'android 4'))         .pipe(plugins.rename({ suffix: '.min' }))         .pipe(plugins.minifycss())         .pipe(reload({stream:true}))         .pipe(gulp.dest('css'))         .pipe(plugins.livereload())         .pipe(plugins.notify({ message: 'styles task complete' })); }); 

and relevant line file: font/base/stylesheet.css, included of above sourced files so: @import (less) '../font/base/stylesheet.css'; (the less directive being used here use variable - @{font_path_prefix} - within file handle fact included various different locations) :

@import url("http://fast.fonts.net/t/1.css?apitype=css&projectid=api_key"); 

now issue itself: of last friday getting 500 error browsing url, results in gulp failing with:

[09:55:33] starting 'styles'... [09:55:33] finished 'styles' after 420 ms  events.js:72         throw er; // unhandled 'error' event               ^ error: broken @import declaration of "http://fast.fonts.net/t/1.css?apitype=css&projectid=api_key" - error 500 

i've tried few things far in vain:

in font/base/stylesheet.css file have tried adding keywords css , optional @import line (both , alone), same result either way.

i found events.js file part of browsersync module, don't use (gulp running on headless server me, no browser speak of), tried commenting lines: .pipe(reload({stream:true})) , .pipe(plugins.livereload()), result unchanged.

i speaking fonts.com why gettign 500 error of sudden, @ heart of feel gulp-less shouldn't trying load urls when css keyword used - import statement should getting output directly browser handle when loads css, right?

i feeling maybe prevent error being thrown, haven't gotten anywhere on front. tried changing error handler for:

.on('error', function(){plugins.util.log(arguments);return;} 

...as read on gulp-less page error should not thrown if there handler it, , figured util.log handler may re-throw error, didn't anywhere.

what's best course of action here? pageview tracking url, don't care whatsoever if loads or has valid css in (especially not @ compile time), need import statement in final css fonts.com's requirements.

came across same error last friday also. think main issue here making http call fonts.com (fast.fonts.net) returns 500 error. fix we're using https working expected.

i'm not sure why http throws 500 error maybe they're supporting https now... possibly? however, can't find mention of anywhere i'm treating bug now. if support has been stopped i'd expect redirects put in place.

also, can fix problem in gulp pipeline too. need pass in processimport parameter minifycss false.

...   .pipe(plugins.minifycss({processimport: false}))   ... 

that not try include fast fonts url part of css... , should speed too. it's not gulp-less throwing error, thought, minifycss (which wrapper around clean-css).

note: may want check final css make sure it's including else correctly (should less processing has been done).

anyone else know fast.fonts.net returning 500? i've tweeted @ support not answer. can't find mention of elsewhere.

edit: you'll see comparing response both
http://fast.fonts.net/t/1.css?apitype=css&projectid=api_key and
https://fast.fonts.net/t/1.css?apitype=css&projectid=api_key


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -